

- #BIND A HOTKEY HAMMERSPOON HOW TO#
- #BIND A HOTKEY HAMMERSPOON INSTALL#
- #BIND A HOTKEY HAMMERSPOON ZIP FILE#
- #BIND A HOTKEY HAMMERSPOON CODE#
Play/pause music players when headphones are connected/disconnected. Use Fn + h/l/j/k as arrow keys, y/u/i/o as mouse wheel, ,/. Add some missing hotkeys for opening a note in Evernote, and for common tag sets. This can be used to execute other startup or configuration actions that are not covered by the other attributes. Thie plugin generates EmmyLua annotations for Hammerspoon and any installed Spoons. I am working on a rewrite that I hope can mitigate this, but since it's a fundamental re-write of hs.hotkey and hs.eventtap, it's proceeding slowly.

Start is a boolean value which indicates whether to call the Spoon’s start() method (if it has one) after configuring everything else.įn specifies a function which will be called with the freshly-loaded Spoon object as its first argument. Doing so has it's own issues, most notably that when Hammerspoon gets bogged down for any reason, keyboard input across all applications pauses until Hammerspoon goes idle again. The valid values for this attribute are ‘nothing’, ‘error’, ‘warning’, ‘info’, ‘debug’, or ‘verbose’. Loglevel sets the log level of the logger attribute within the spoon, if it exists. Type the following in the Hammerspoon console, or add it to your a file and reload the configuration: Once a Spoon is installed, you need to use the hs.loadSpoon() function to load it.
#BIND A HOTKEY HAMMERSPOON INSTALL#
Hammerspoon will install the Spoon under ~/.hammerspoon/Spoons/.
#BIND A HOTKEY HAMMERSPOON ZIP FILE#
To install the spoon, download its zip file from, unpack it, and double-click on the resulting MouseCircle.spoon file. Using a Spoon to locate your mouseĪs a first example, we will use the MouseCircle spoon, which allows us to set up a hotkey that displays a color circle around the current location of the mouse pointer for a few seconds, to help you locate it. See also the first article in this series. FWIW I would strongly encourage you to use Karabiner Elements for creating a Hyper key - Brett's Hammerspoon setup was necessary initially because kernel changes made the old Karabiner incompatible with High Sierra (or maybe it was Sierra - I forget), but Karabiner Elements is now very capable and can remap keys at a much lower level than we can. They are also a good way to share your own work with other users. Spoons provide a predefined API to configure and use them. Click the Hammerspoon menu icon and select 'open config' (or open. Pressing d will activate the layer with g and y.Īt each level, a helper text is shown, like which-key in emacs.In this second article about Hammerspoon, we look into Spoons, modules written in Lua which can be easily installed and loaded into Hammerspoon to provide ready-to-use functionality. Now that we have a combined modifier key, we need to bind it in Hammerspoon and send mute toggle commands to Zoom and Teams. Here, pressing option+space activates the first layer with b, t, d (browser, terminal, domain respectively) hs.loadSpoon("RecursiveBinder") - Load the spoon
#BIND A HOTKEY HAMMERSPOON CODE#
Here's the code to put into a: - SCI-HUB with CMD + ALT + CTRL + h on safari tab. So I automated the task with a function and a keybinding programmed in lua for those of you using (the wonderful) hammerspoon.
#BIND A HOTKEY HAMMERSPOON HOW TO#
Here is a minimal lua snippet on how to use it. Safari extension to open current publication without having to load sci-hub site and pasting the url. I wrote a Medium article about how to use it to make a leader key for macOS. If you're still wondering how to do this, then the RecursiveBinder Spoon for Hammerspoon will do the trick.
