That works well with the above for essentially typing in a subcommand. Rather than immediately ending the modal, I can set it so that after 100ms (for example) without hitting a key that does something, it stops listening. Or w,e,d to move to top+right third instead of half.ĭebouncing for chords. Perhaps (to keep things on my left hand), I could use a Chord with wasd for moving windows around? And because it’s within a chord, I can actually hit more than one key. I already have my terminal on ⌥-a and Dropbox Dash (formerly Command E) on ⌥-s. Since I have Caps Lock bound to Option (⌥), this fits. So instead of ⌘⌃+c, s for screenshots, I could have ⌥+g, c, s for Go Capture S screenshot. Well, one thing I want to try is multiple levels of Chords. So instead of having to register each of them, I just have to import them and use the one init_keys function to reload them all. run any registered functions for name, f in pairs(key_chords) do print( ' Running key function: '. Last but not least, I have another chord for running programs specifically with additional parameters (so Spotlight or Dash wouldn’t pick them up): And it works great! Albeit not for taking screenshots of itself. What that does do though is let me send a non-chord keyboard shortcut to Capture: Basically, what we’re doing is capturing the chord ( ⌘⌃+c, s for example) and then immediately turning around and firing off another keyboard shortcut ( ⌘⌃⇧+1)… that–doesn’t help at all to save those ~78k… but that’s a lot anyways. Hs.eventtap.keyStroke( '⌘⌃⇧', '4') - mute captureMode:exit()ĬaptureMode:bind( '', 'SPACE', function() For example, if you use the Seal spoon (a configurable launcher), you need to call its loadPlugins() method to specify which Seal plugins to use.CaptureMode = hs.( '⌘⌃', 'c') This can be used to execute other startup or configuration actions that are not covered by the other attributes. 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. With the below Hammerspoon settings, we can use shortcuts to launch/switch apps EVEN the app is not launched yet. The valid values for this attribute are ‘nothing’, ‘error’, ‘warning’, ‘info’, ‘debug’, or ‘verbose’. Hammerspoon: use the keyboard shortcuts to launch Apps We can use command + tabto switch between opened apps, but it may require multiple strokes, also the list only contains opened apps. 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. Hammerspoon will install the Spoon under ~/.hammerspoon/Spoons/. 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. They are also a good way to share your own work with other users. Spoons provide a predefined API to configure and use them. 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.
0 Comments
Leave a Reply. |