Hacker News new | ask | show | jobs
by shbooms 1692 days ago
> Setting up ergonomic custom keyboard shortcuts is painful and requires (multiple?) third-party applications to do well.

Take a look at Hammerspoon[0] for this if you haven't already. It requires some work to get it working the way want (you'll be writing some basic Lua code) but it's by far the best, all-in-one solution I've found for this problem on macOS. It has a ton of built-in modules for automating things including being to setup hotkeys globally as well as modal/on per-app basis

[0] https://github.com/Hammerspoon/hammerspoon

2 comments

If Lua scripting doesn't float your boat and you don't mind commercial software, Keyboard Maestro[0] is brilliant. I use it for:

* Expanding text macros (like TextExpander but not with a subscription)

* Automating web forms I have to fill out frequently (find the "Last Name" button; send "Smith"; hit "tab"; send "Joe"; find the "Submit this form" button and press it).

* Opening apps with hotkeys.

* Scripting stuff that isn't scriptable, like "find the Music app; right click on the ... menu; click Share; click Copy Link" to get the currently playing song's URL. (PS: If you know how to reliably get this another way, please let me know.)

* Doing really nifty things with OCR on the screen, like "send this set of keypresses, then look for the text that says 'I accept this', put the mouse over it, and click it" for apps that don't use native widgets.

Hammerspoon is super cool too, but I don't have the time to really tweak it as much as I can Keyboard Maestro.

[0] https://www.keyboardmaestro.com/main/

Hammerspoon is what makes macOS usable for me (plus karabiner for caps lock twiddling). The randomly rearranging layout of mission control has to be the most user hostile annoyance I have ever experienced in an OS to date.

Ironically, there isn't anything equivalent to it in linux land, and once I had gotten some really nice customizations, going back makes me a little sad.

If you’re talking about spaces automatically swapping around, you can disable that functionality in System Preferences-Mission Control, just fyi.