Hammerspoon is the glue that holds my Mac together. For a starter list of things to do with this app, a partial list of the things that I'm using it for: - Dumping all open Safari tabs to an Obsidian doc - Adding 'hyper' (Ctrl-Opt-Cmd) keybinds to pop a new window for: - Safari - Finder - Terminal / Ghostty - VS Code - Notes - Editing Hammerspoon/AeroSpace/Sketchybar config - Reloading Hammerspoon config - Reloading…
Hammerspoon
121–130 of 154 posts
Re: Hammerspoon
#122Re: Hammerspoon
#123I’ll have a hell of a time rewriting everything into Lua when I have soooo many node packages I leverage.
Re: Hammerspoon
#124Shameless plug/proud self-promotion - https://github.com/agzam/spacehammer "Spacemacs|Doom inspired Hammerspoon modal toolkit" I can't even work on Mac without it. It let's you do stuff like "alt+spc a b" (apps -> browser) or "alt+spc m j/k" (media -> vol up/down), or edit just about any text of any app in your editor (Emacs atm) - with all the tools you have there - spellchecking, thesaurus, translation, LLMs, etc.…
> "alt+cmd m j/k" (media -> vol up/down) if only keyboards came with built in buttons for adjusting the volume… oh wait. Unless of course you are suffering on a touch bar mac, then I completely understand.
Re: Hammerspoon
#125Hammerspoon maintainer here - I'm enjoying reading all the comments, and hoping that everyone isn't going to be annoyed that I'm mostly working on a v2 atm, which switches from Lua to JavaScript :D
> a v2 atm, which switches from Lua to JavaScript :D Presumably that'll be released in [checks calendar] 18 days?
Re: Hammerspoon
#126Re: Hammerspoon
#127Earlier quoted context omitted.
> a v2 atm, which switches from Lua to JavaScript :D Presumably that'll be released in [checks calendar] 18 days?
Maybe not: https://www.reddit.com/r/hammerspoon/comments/1puln7j/110_re... https://github.com/cmsj/Hammerspoon2
I'd take a minor quibble with one of the Reddit commentators:
> "Lua is a language that was built for people that are not programmers, and Hammerspoon (or at least building it's extensions) is targeted specifically at programmers."
Hammerspoon[0] isn't targeted at programmers because it's abstracting hard things (interfacing with macOS system libraries, etc.) into easier ones (the Lua spoons) where accessibility to non-programmers is surely a goal.
[0] I'm excluding extensions because the included spoons cover many scenarios people would be interesting in using and, to be honest, building "extensions" to something as tricky as Hammerspoon would be beyond many programmers[1], never mind non-programmers.
[1] I'm reasonably experienced and pretty fast at the "huh? search experiment kludge test passable code" cycle even with completely new technologies and I definitely wouldn't be keen on attempting a Hammerspoon extension.
Re: Hammerspoon
#128Hammerspoon maintainer here - I'm enjoying reading all the comments, and hoping that everyone isn't going to be annoyed that I'm mostly working on a v2 atm, which switches from Lua to JavaScript :D
>Hammerspoon maintainer .. Yay! :D >.. enjoying .. :) >Lua to JavaScript :\ Well, I have been a long user of Hammerspoon, and Lua, so thanks for the great app, it made a difference for me for a long time .. would be happy to hear why , but don’t feel obliged, the switch to JS over Lua, but anyway, thanks again!
The more complex answer is that Hammerspoon is currently about 100k lines of Objective C, and none of us really want to work on it anymore when Swift is the much nicer place to be doing macOS development.
Technically we could slowly convert in-place from ObjC to Swift, but there will always be a need for "LuaSkin", the bridging code we've accumulated over the last 13+ years, and rewriting that in Swift would be significantly complicated.
JavaScript, however, is already bridged for us because WebKit needs it.
Re: Hammerspoon
#129Earlier quoted context omitted.
Maybe not: https://www.reddit.com/r/hammerspoon/comments/1puln7j/110_re... https://github.com/cmsj/Hammerspoon2
Well, I guess the motivation (use a more easily integrated extension language) makes sense but ugh, Javascript is a dirty sack of sewage. I'd take a minor quibble with one of the Reddit commentators: > "Lua is a language that was built for people that are not programmers, and Hammerspoon (or at least building it's extensions) is targeted specifically at programmers." Hammerspoon[0] isn't targeted at programmers becau…
Where JS massively wins here, to my mind, is that there is so much tooling available for it, to the point that I'm already not actually writing my v2 config in JS at all, I'm writing it in TypeScript and compiling it to JS.
Re: Hammerspoon
#130Hammerspoon maintainer here - I'm enjoying reading all the comments, and hoping that everyone isn't going to be annoyed that I'm mostly working on a v2 atm, which switches from Lua to JavaScript :D
Thank you for your work on Hammerspoon! I’ve been using it for years. Would you mind elaborating on your vision for v2? Was there a certain limitation in the previous architecture that you’re trying to avoid this time around? Was there something in particular that drew you to choosing JavaScript for this version?
Honestly, in 2026, I do not want to be maintaining a 100k line Objective C program.
So, my current experimentation with a v2 is to see how easily I can catch up with where v1 is, just using Swift and JavaScriptCore.
There are lots of things about the Lua APIs that I don't like, and I'm addressing some of those as I go, but I'm currently in a phase where I'm targeting parity with everything I need for my v1 config, at which point I can cut over to running v2 and then see how things are looking and what can be refined/reworked.