Hammerspoon
81–90 of 154 posts
Re: Hammerspoon
#82Hammerspoon 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
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?
Re: Hammerspoon
#83Hammerspoon 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 is basically my only reason to write Lua, a language which I really like. I am sure JavaScript is a more pragmatic choice but I will be slightly saddened by it regardless.
Re: Hammerspoon
#84It's this like Mac equivalent to autohotkey on windows?
Re: Hammerspoon
#85I fake a tiling window manager on Mac with Hammerspoon, resizing to fit in specific corners/sizes: -- resize based on ratios function ratioResize(xr, yr, wr, hr) return function () local win = hs.window.focusedWindow() win:moveToUnit({x=xr,y=yr,w=wr,h=hr}) end end -- 4 corners, different sizes hs.hotkey.bind({"cmd", "ctrl"}, "w", ratioResize(0, 0, 2/5, 2/3)) hs.hotkey.bind({"cmd", "ctrl"}, "e", ratioResize(2/5, 0, 3/…
Re: Hammerspoon
#86I'll be sad when it moves from Lua to JavaScript, but I guess that's better than moving to Tcl.
Re: Hammerspoon
#87Hammerspoon 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…
Re: Hammerspoon
#88Earlier quoted context omitted.
Make caps lock a hyperkey (shift+ctrl+option+cmd) and use that for non-overlapping shortcuts
make caps lock control on hold, double quote on tap. Make control hyperkey on hold, angle bracket on tap. My keyboard firmware is very odd. This is not easily done with soft remaps to the point that I don't bother trying.
Re: Hammerspoon
#89Hammerspoon 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…
> - Dumping all open Safari tabs to an Obsidian doc I'd love to do this too. Would you mind sharing how you do it? Or is it trivially easy and not worth explaining? (I haven't looked too deeply into HS yet.)
- Brings in the date path components for the dumped-to folder
- Makes a hash of the URL for an Obsidian doc (each tab gets their own doc)
- Uses Chrome command line (--headless --disable-gpu --dump-dom) to save a snapshot of the page contents
- Uses it again with --screenshot to make a thumbnail
- Create an Obsidian doc from a template
- If it's a single tab dump, pass -o to the script, which opens it in Obsidian for review
Lastly, I use the relatively-new Bases feature in Obsidian to make a nice "cards" view of the docs with their thumbnails.I'm hoping to clean it up at some point and maybe release it, but it's one of those classic one-shot systems that just works for me for now.
Re: Hammerspoon
#90Hammerspoon 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