

Various features/facilities for developers who are working on Hammerspoon itself, or writing extensions for it. Some functions for manipulating the Hammerspoon console. Graphical, interactive tool for choosing/searching data Watch for display and system sleep/wake/power eventsĪ different approach to drawing in HammerspoonĪ sub module to hs.canvas which provides support for basic matrix manipulations which can be used as the values for transformation attributes in the hs.canvas module. Represents the service records that are discovered or published by the hs.bonjour module.Ĭontrol system power states (sleeping, preventing sleep, screen locking, etc)
#Hammerspoon open application dock keyboard code#
Not all notifications are supported by all elements and not all elements support notifications, so some trial and error will be necessary, but for compliant applications, this can allow your code to be notified when an application's user interface changes in some way.įind and publish network services advertised by multicast DNS (Bonjour) with Hammerspoon.

This submodule allows you to create observers for accessibility elements and be notified when they trigger notifications.

This submodule allows hs.axuielement to support using AXTextMarker and AXTextMarkerRange objects as parameters for parameterized Accessibility attributes with applications that support them. This module allows you to access the accessibility objects of running applications, their windows, menus, and other user interface elements that support the OS X accessibility API. Watch for system level audio hardware events Inspect/manipulate the data sources of an audio device Watch for application launch/terminate events 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.Easily find hs.application and hs.window objects 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. I've got another hotkey set up to unset it (semicolon+e).Ĥ) You may have noticed I'm using keyboard shortcuts with semicolon as a modifier key. 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). Now my work music is a single keyboard shortcut (semicolon+m) and a few miliseconds away.ģ) Set up screen recording. 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/. 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.Ģ) Start/stop playing my work playlist of lofi hiphop. Here are the top ways I'm using it right now:ġ) Hide/show apps similar to how iTerm lets you bind a hotkey to hide/show a terminal. It's one of the first must-have-for-a-usable-laptop tools I set up when I get a new MacBook.
