Files
dotfiles/hammerspoon/hosts/noct.lua
Jim Myhrberg ab0de76e79 feat(hammerspoon/app_toggle): enable multi-app toggles
A multi-app toggle is a keybinding which is configured to toggle 2 or
more applications.

This is intended as a context-ish-aware toggle, as it will only toggle
the most recently focused application. This essentially enables you to
bind a category/class of applications to a single hotkey, and whichever
of the apps that's running and was most recently focused is the one that
will be toggled.
2023-04-23 16:28:21 +01:00

35 lines
1.0 KiB
Lua

local obj = {}
function obj.init()
local apptoggle = require('app_toggle')
apptoggle:bind({ 'cmd', 'alt', 'ctrl' }, 'A', { 'Activity Monitor' })
apptoggle:bind({ 'cmd', 'ctrl' }, '4', { 'Microsoft Edge' })
apptoggle:bind({ 'cmd', 'ctrl' }, 'A', { 'Messages' })
apptoggle:bind({ 'cmd', 'ctrl' }, 'C', { 'Calendar' })
apptoggle:bind({ 'cmd', 'ctrl' }, 'D', { 'Mailplane' })
apptoggle:bind({ 'cmd', 'ctrl' }, 'F', { 'Element Nightly' })
apptoggle:bind({ 'cmd', 'ctrl' }, 'S', { 'Music' })
apptoggle:bind({ 'cmd', 'ctrl' }, 'T', { 'Discord PTB' })
apptoggle:bind({ 'cmd', 'ctrl' }, 'X', { 'Notion' })
apptoggle:bind({ 'cmd', 'ctrl' }, 'Z', { 'Slack' })
apptoggle:bind({ 'cmd', 'ctrl' }, '2',
{ 'ChatGPT X' },
{ 'ChatGPT' }
)
apptoggle:bind({ 'cmd', 'ctrl' }, 'B',
{ 'TablePlus' },
{ 'Lens' }
)
apptoggle:bind({ 'cmd', 'ctrl' }, 'E',
{ 'Emacs', '/Applications/Emacs.app' }
)
apptoggle:bind({ 'cmd', 'ctrl' }, 'W',
{ 'Code', '/Applications/Visual Studio Code.app' }
)
end
return obj