

But the hammerspoon rotate method that I'm attempting to call definitely takes a number, not whatever "userdata" is. But I assume that it has to be the new function, because that's all I changed, and the error was triggered on attempting to run it. The line numbers, interestingly, in the traceback are not correct at all: in config.fnl those lines are comments. : in field 'rotate' /Users/myhomedir/.spacehammer/config.fnl:24: Type 'number' for argument 1 (expected userdata) stack traceback: 17:24:59: 17:24:59 ERROR: LuaSkin: hs.timer callbackĮrror: /Users/myhomedir/.spacehammer/config.fnl:24: ERROR: incorrect

But when I try to run it, all of a sudden I get errors coming from c-land: hs.hotkey: Create and manage global keyboard. It bridges various system level APIs into a Lua scripting engine, allowing you to have powerful effects on. hs.host.locale: Retrieve information about the users Language and Region settings. Hammerspoon is a desktop automation tool for macOS. hs.host: Inspect information about the machine Hammerspoon is running on. hs.hints: Switch focus with a transient per-application keyboard shortcut. Right? It's your basic lisp translation, it should work perfectly fine. HID interface for Hammerspoon, controls and queries caps lock state. Then I go to port over my simple preexisting functions: I translate my lua function into a Fennel function with a slightly different name: (fn rotate-vertical So first I get spacehammer working, and verify that the default configuration works fine and doesn't throw any errors. Ok, I like lisps, I can handle a config file in a lisp, right?
#HAMMERSPOON DOCS CODE#
I had the following, correctly-working, code in my a file for hammerspoon to go get my external monitor and switch it to vertical: function rotate90()īut then I realized that I wanted to use the pre-built modal menu toolkit spacehammer, which is basically like spacemacs for hammerspoon-but which is written in Fennel. Caveat: I don't really know lua or fennel, though I do have a lot of experience in lua-like languages (python etc.) and fennel-like languages (clojure, elisp, etc.).īut: I was using hammerspoon to manage external monitor configuration on my mac.
