Assign every window a sigil for quick access.
A letter or digit is rendered in the titlebar of every window, and actions can be bound inside a "sigil" mode with different modifiers. For example, with no modifiers, the the sigil key can focus the window. If the 'enter' action is bound to control-w, then 'control-w c' will focus the window with sigil 'c'.
The keys 'h', 'j', 'k', and 'l' are reserved for the window west, south, north, and east of the currently focused window in standard Vi-like fashion, and so are not assigned as sigils.
By default, two keys (other than the sigils) are bound in the mode: escape leaves the mode without doing anything, and '.' sends the sigil key to the focused window. This allows sending 'control-w' to the underlying window by typing 'control-w .'.
Download: https://github.com/Hammerspoon/Spoons/raw/master/Spoons/WindowSigils.spoon.zip
Usage example:
sigils = hs.loadSpoon("WindowSigils")
sigils:configure({
hotkeys = {
enter = {{"control"}, "W"}
},
mode_keys = {
[{{'shift'}, 'i'}] = ignore_notification,
[{{}, 'v'}] = paste_as_keystrokes,
[{{}, ','}] = rerun_last_command,
},
sigil_actions = {
[{}] = focus_window,
[{'ctrl'}] = swap_window,
[{'alt'}] = warp_window,
}
})
sigils:start()
Signature | WindowSigils.logger |
---|---|
Type | Variable |
Description | Logger object used within the Spoon. Can be accessed to set the default log level for the messages coming from the Spoon. |
Signature | WindowSigils:bindHotkeys(mapping) |
---|---|
Type | Method |
Description | Binds hotkeys for WindowSigils Parameters:
|
Signature | WindowSigils:bindModeKey(mods, key, action) |
---|---|
Type | Method |
Description | Bind an extra action to be triggered by a key in the sigil mode. Parameters:
|
Signature | WindowSigils:bindSigilAction(mods, action) |
---|---|
Type | Method |
Description | Bind an action to be triggered in the sigil mode when a window's sigil key is pressed. Parameters:
|
Signature | WindowSigils:configure(configuration) |
---|---|
Type | Method |
Description | Configures the spoon. Parameters:
|
Signature | WindowSigils:orderedWindows() |
---|---|
Type | Method |
Description | A list of windows, in the order sigils are assigned. |
Signature | WindowSigils:refresh() |
---|---|
Type | Method |
Description | Rerender all window sigils. Parameters: |
Signature | WindowSigils:start() |
---|---|
Type | Method |
Description | Starts rendering the sigils and handling hotkeys Parameters: |
Signature | WindowSigils:stop() |
---|---|
Type | Method |
Description | Stops rendering the sigils and handling hotkeys Parameters: |
Signature | WindowSigils:window(sigil) |
---|---|
Type | Method |
Description | Find the window with the given index or sigil. Parameters:
|