These are my configuration files for Hammerspoon.
- Install Hammerspoon.
- `git clone https://github.com/thelastnode/dot-hammerspoon ~/.hammerspoon
- Restart Hammerspoon.
Launch mode lets you quickly get to an app by hitting a key chord (ctrl + ⌘ + a). For example, ctrl + ⌘ + a followed by v
will open Visual Studio Code.
Google Chrome has some special handling for multiple profiles. Assuming there are two profiles (Work
and Ankit
), 1
will switch to the Work
window and 2
will switch to the Ankit
(personal) window.
You can also configure shortcuts to get to pinned tabs in different profiles.
Figma desktop has a feature to open a file URL from the clipboard - this is bound to ctrl + ⌘ + a followed by shift + f.
This module lets you snap windows using your keyboard with vim-style directions (hjkl).
Start with ctrl + ⌘ + 2 to enable window mode, then any of the following:
- space: snap to fill the screen
- hjkl: snap to the left, down, up, or right half of the screen
- uom.: snap to the the corners of the screen
- ⌘ + hl: snap to left or right 70% of the screen
- ctrl + hjkl: move to the left, down, up, or right screen (does not exit window mode, so can be followed by one of the above snapping commands)
This module captures which window is active to a SQLite database located at ~/.hammerspoon/data/timetracker.sqlite3
. It has special handling for Google Chrome to capture URLs.
It also includes a datasette metadata file to see usage in Datasette. This can be run with:
datasette ~/.hammerspoon/data/timetracker.sqlite3 --metadata ~/.hammerspoon/timetracker/datasette-metadata.yml
After Datasette is running, you can see usage for the day by opening this link (by default).
This automation turns on an Elgato key light via Home Assistant when a camera is detected via USB. This requires a Home Assistant token in ~/.hammerspoon/homeassistant
. If the token is missing, the automation will not register.
The ScreenRecordingMode
function is a convenience utility to center a window on screen and resize it to 1080p. To use it, run ScreenRecordingMode()
in the Hammerspoon console, then click a window to center it on screen, resize it to 1080p, and open CleanShot X's all-in-one capture mode.
You can also pass in a custom width and height for the window, e.g.: ScreenRecordingMode{ w = 800, h = 600 }
.