

This is useful because it usually isn’t used anywhere else, and is available in a very distinct spot on Apple keyboards, where it is easy to hit.
Hammerspoon hacks mac#
The app_switcher config tells it to switch to push-to-talk state when Zoom is running.īy default the PushToTalk spoon uses the Fn key on Mac as the PTT key. This can be useful in meetings where you are the primary speaker.īy default the spoon starts in muted.

Then load it by adding this to your config.
Hammerspoon hacks install#
Spoon installationįirst, download the spoon and install it. This is accomplished using the PushToTalk spoon and some config. When you want to speak, just hold down the specific key the entire time you are speaking. This way, you always leave Zoom unmuted, but you are still muted because the microphone is off. This tip uses Hammerspoon to globally mute the system microphone, and enable it when a particular key is held down, regardless of which app you are in. This can get annoying when you are sharing your screen, or doing something in another app while you want to talk. However, this only works when the Zoom app is in focus. When using Zoom, one can stay muted, and then hold down Space to temporarily unmute.

For example, you could detect a GitHub username/repo pattern and map it to a GitHub URL, or identify some kind of CI job and actually make a request to the CI server to check for the job status. Or you could pattern match on the selection itself to do something specific. This is actually a very flexible set up where you could specify multiple bindings to do different actions to the selection. The Cmd+Ctrl+J binding simply saves the current selected text, and replaces it with a JIRA URL prefix. The short sleep is to allow the copy to propagate through the system and transfer the contents to the clipboard. This uses the accessibility API to retrieve the currently selected text, but if that doesn’t work, it just simulates pressing Cmd+C to invoke a copy. Local elem =hs.uielement.focusedElement() Copied from function currentSelection() This would replace the selected text, with a link! Apps like Slack and Dropbox Paper are smart enough to treat this replacement as a linking action, since it is accomplished using a regular “paste” as if the user had pressed Cmd+V themselves. With Hammerspoon, I was able to do the following:
Hammerspoon hacks plus#
Plus JIRA has this annoying tendency to use some other URL when showing some issue, and it is easier to just type out the identifier in those cases. Of course, one could always copy paste the issue link instead of just the identifier, but the latter often looks cleaner. if you have PROJ-1234 as the ticket, JIRA will link to it), other applications are not. While JIRA is smart enough to do this within itself (i.e. We used JIRA at Dropbox, and I always preferred to have JIRA issue identifiers actually be links to the issue when possible. This uses the Hammerspoon CLI hs to call the function when the alias is run. ImportsĪlias nag_screen = 'hs -A -c "nagScreen()"' Here is how we hook this up in the Hammerspoon a. It is triggered by some shell aliases that I append to the end of the command.įor example, I can run: bazel build //something nag_screenĪnd my screen will start flashing once the build ends (regardless of success/failure), until I switch to the terminal. My solution is to use Hammerspoon to invert the entire display’s colors and keep “flashing” the display until I switch back to the terminal window. I’ve found that my brain is not great at noticing desktop notifications, since they tend to be in the top-right corner of a large display. There is a danger of getting distracted and continuing to read even when the tests are done. The usual way I respond is to continue reading the next article on my reading list. I often run build steps or unit tests that are slow enough that I can’t just twiddle my thumbs at the terminal, but fast enough that I can’t get into another cognitive task. There are some crazier applications like using voice to control scroll bars! I’m going to describe some ways I use it that are uncommon. People use it for all sorts of automations, with key remappings and quick window switchers being the most common applications. Hammerspoon is a macOS automation framework that allows you to hook into all sort of OS interfaces using Lua scripts.
