Some previous discussion:
Hammerspoon
41–50 of 154 posts
Re: Hammerspoon
#42How does this compare to AppleScript?
Re: Hammerspoon
#43I use it to enable/disable the wifi when I disconnec/connect the macbook to a specific usb hub with ethernet connection: local usbWatcher = hs.usb.watcher.new(function(device) if device.productName == "EMEET SmartCam C960" then if device.eventType == "added" then hs.execute("networksetup -setairportpower en0 off") hs.notify.new({title="Wi-Fi", informativeText="Disabled (USB device connected)"}):send() elseif device.e…
https://support.apple.com/en-ca/guide/mac-help/mchlp2711/mac
Re: Hammerspoon
#44I 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.
You can plug it to your favorite WM (I'm currently using Yabai) and do tons of other interesting things. Because it's all written in Fennel, one can develop things in a tight feedback loop with a connected REPL - e.g., I can ask Claude to inspect things in the running Slack app or Firefox and make interesting automations - all without ever leaving my editor.
Re: Hammerspoon
#45Re: Hammerspoon
#46I 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/…
It's nice to be able to iterate through the halves/thirds configurations for different cases.
Re: Hammerspoon
#47I always confuse "hammerspoon" and "rowhammer"
Re: Hammerspoon
#48Re: Hammerspoon
#49I 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/…
I highly recommend Aerospace[1], went through a few approaches, I cared about not completely compromising security either, it works really well if you come from something like i3 1. https://github.com/nikitabobko/AeroSpace
- the switch goes through, Left displays workspace 1, right displays 3 (desired state)
- Application B is focused, presumably because its window on 3 becomes active (also desired)
- Display Left switches to display workspace 2, presumably because it contains a window belonging to the newly focused application B? (I don't want this)
- the window of application B on workspace 2 steals focus from the one on workspace 3 (???)