Skip to content

Instantly share code, notes, and snippets.

@masonlr
Last active April 2, 2020 16:41
Show Gist options
  • Save masonlr/ee222f8e7facc2ed6aa719d35e5ddf06 to your computer and use it in GitHub Desktop.
Save masonlr/ee222f8e7facc2ed6aa719d35e5ddf06 to your computer and use it in GitHub Desktop.
-- assume karbiner-elements maps capslock to hyper
local hyper = {"⌘", "⌥", "⌃", "⇧"}
function open(name)
return function()
hs.application.launchOrFocus(name)
end
end
-- modal to toggle appswitcher
k = hs.hotkey.modal.new(hyper, 'e')
function k:entered() hs.alert('App switcher mode', {radius=4}, 1)
end
function k:exited() hs.alert('Native mode', {radius=4}, 1)
end
k:bind(hyper, 'e', function() k:exit() end)
k:bind('cmd', '1', nil, open('iTerm'))
k:bind('cmd', '2', nil, open('Firefox'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment