/ hammerspoon / config / keymaps.lua
keymaps.lua
 1  Keymaps = {}
 2  
 3  -- Command mappers --
 4  Keymaps.CMD = { 'cmd' }
 5  Keymaps.CMD_REV = { 'cmd', 'shift' }
 6  Keymaps.LEADER_2 = { 'ctrl', 'alt', 'cmd' }
 7  
 8  -- Commands --
 9  hs.hotkey.bind(Keymaps.LEADER_2, 'R', function()
10    hs.reload()
11  end)
12  hs.alert.show('🔨 Hammerspoon reload')
13  
14  -- Leader Commands
15  Keymaps.LEADER = hs.hotkey.modal.new('alt', 'o')
16  
17  function Keymaps.LEADER:entered()
18    if hs.eventtap.isSecureInputEnabled() then
19      hs.alert('⚠️ Secure Input is on. Hyper Mode commands might not work.')
20    end
21    print('triggered leader mode')
22  end
23  
24  function Keymaps.LEADER:exited()
25    print('exited from leader mode')
26  end
27  Keymaps.LEADER:bind('', 'escape', function()
28    Keymaps.LEADER:exit()
29  end)
30  
31  Keymaps.LEADER:bind('alt', 'J', '🔗 google-chrome', ChromeWithProfile)
32  Keymaps.LEADER:bind('alt', 'K', '🔑 password-store', ChoosePassword)
33  
34  return Keymaps