aboutsummaryrefslogtreecommitdiffstats
path: root/.hammerspoon/hyper.lua
blob: 2124bca8b02a849ada1c4fea96ca78641a49adff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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