I love Hammerspoon. It's one of the first must-have-for-a-usable-laptop tools I set up when I get a new MacBook.
Here are the top ways I'm using it right now:
1) Hide/show apps similar to how iTerm lets you bind a hotkey to hide/show a terminal. I've got ctrl+space set to Vimcal, alt+space set to midnight.app (a time tracker I'm building), and ctrl+alt+space set to Things.
2) Start/stop playing my work playlist of lofi hiphop. I got tired of the friction around opening Spotify, going into my work playlist, hitting play, waiting several moments for the playlist to load, etc, so I downloaded a bunch of mp3s from YouTube and put them in ~/Music/work/. Now my work music is a single keyboard shortcut (semicolon+m) and a few miliseconds away.
3) Set up screen recording. There are a few things that need to happen before I start a screen recording (opening CamHead.app, setting my screen resolution, and showing the dock at a certain height so I can later crop the video to 16:9) and I have it all bound to a single hotkey (semicolon+r). I've got another hotkey set up to unset it (semicolon+e).
4) You may have noticed I'm using keyboard shortcuts with semicolon as a modifier key. That's done with Hammerspoon too! I've got an extra layer of hotkeys available to me to set up whatever else I can think of in the future. The code I wrote to use semicolon like this sometimes breaks if I try to type too many actual semicolons in a row but I usually rely on JS Beautify to add those for me.
> I got tired of the friction around opening Spotify, going into my work playlist, hitting play, waiting several moments for the playlist to load, etc, so I downloaded a bunch of mp3s from YouTube and put them in ~/Music/work/. Now my work music is a single keyboard shortcut (semicolon+m) and a few miliseconds away.
Aka how everyone did it before Spotify took off.
But actually, I'm told time and again that Spotify has some APIs to control it—presumably when desktop apps are used (dunno for sure because don't use it myself). Personally I'd use Alfred for that over shortcuts.
Yes. There are terminal applications to control Spotify. You need to add an API key in order to use them/it. So apparently you can write your own controller.
The Spotify app also has to be running in order to use the terminal application (at least the one that I tried).
Here are the top ways I'm using it right now:
1) Hide/show apps similar to how iTerm lets you bind a hotkey to hide/show a terminal. I've got ctrl+space set to Vimcal, alt+space set to midnight.app (a time tracker I'm building), and ctrl+alt+space set to Things.
2) Start/stop playing my work playlist of lofi hiphop. I got tired of the friction around opening Spotify, going into my work playlist, hitting play, waiting several moments for the playlist to load, etc, so I downloaded a bunch of mp3s from YouTube and put them in ~/Music/work/. Now my work music is a single keyboard shortcut (semicolon+m) and a few miliseconds away.
3) Set up screen recording. There are a few things that need to happen before I start a screen recording (opening CamHead.app, setting my screen resolution, and showing the dock at a certain height so I can later crop the video to 16:9) and I have it all bound to a single hotkey (semicolon+r). I've got another hotkey set up to unset it (semicolon+e).
4) You may have noticed I'm using keyboard shortcuts with semicolon as a modifier key. That's done with Hammerspoon too! I've got an extra layer of hotkeys available to me to set up whatever else I can think of in the future. The code I wrote to use semicolon like this sometimes breaks if I try to type too many actual semicolons in a row but I usually rely on JS Beautify to add those for me.