diff options
Diffstat (limited to '.hammerspoon/hyper.lua')
| -rw-r--r-- | .hammerspoon/hyper.lua | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/.hammerspoon/hyper.lua b/.hammerspoon/hyper.lua new file mode 100644 index 0000000..2124bca --- /dev/null +++ b/.hammerspoon/hyper.lua @@ -0,0 +1,23 @@ +local hyper = hs.hotkey.modal.new({}, nil) + +hyper.pressed = function() + hyper:enter() +end +hyper.released = function() + hyper:exit() +end + +-- Bind the Hyper key to the hammerspoon modal +hs.hotkey.bind({}, "F13", hyper.pressed, hyper.released) + +hyper.bindApp = function(mods, key, app) + local fn = function() + hs.application.launchOrFocus(app) + end + if type(app) == "function" then + fn = app + end + hyper:bind(mods, key, fn) +end + +return hyper |
