Live data from Hacker News

Hammerspoon

github.com

151–154 of 154 posts

Re: Hammerspoon

#151

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…

I pretty much only use it for two (related) things these days: - check the list of open Teams windows; if there's a non-standard one, assume I'm in a meeting and webhook to HomeAssistant to select the "active"[2] preset on my meeting light[0]. - download my work ical[1] and, if there's a pending meeting ( [0] Just a short strip of WS2812B connected to an ESP32 running WLED. [1] Originally this was a simple HTTP to my…

Tossing a couple things out mostly for the people getting ideas from these threads:

I've done something similar, but using the webcam watcher to hook on the webcam being enabled for any reason -- that way when I have that one external meeting on Google Meet or whatever the light still works.

(I also found it useful to have Hammerspoon flip a virtual switch in, well, Hubitat for me, and then automation based on that virtual switch, rather than triggering the light directly. Lets me hang other things off of that virtual switch instead of putting it in Hammerspoon.)

Re: Hammerspoon

#152

This is more powerful than Mac’s own Automator tool, Lua is an interesting choice. Mac Automator used to only support AppleScript but now it supports JavaScriptCore from WebKit so you can run JavaScript with Mac Automator. This is what I do. I’ll have a hell of a time rewriting everything into Lua when I have soooo many node packages I leverage.

Good news for you -- Hammerspoon v2 is going to use Javascript instead of Lua.

Re: Hammerspoon

#153

This might be a dumb quesiton but ... do you think AppleScript was a mistake on Apple's part? My understanding is MacOS has had automation via AppleScript forever, but everytime I've used it the syntax is inscrutable. It feels like if they had chosen Python or JavaScript or Lua we'd see much more automation over the last 20+ years. Is Hammerspoon filling that gap?

AppleScript predates Javascript by two years, but by even more than that in terms of usability. It was definitely designed for "non-programmers", the people buying Macs in the System 7 days.

But modern MacOS is automatable using Javascript in Script Editor, so they're catching up.

Re: Hammerspoon

#154
post #130
post #82

Earlier quoted context omitted.

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?

The limitation is entirely on the developer side - for years now there have only really been three of us working on Hammerspoon with any regularity, and that has been significantly dwindling down to mostly just me and Chris Hocking. 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 usi…

Hi! I'd be interested in contributing to V2 if you're open to it - is there something you need help with specifically?
Post reply on HN