aboutsummaryrefslogtreecommitdiffstats
path: root/.hammerspoon
diff options
context:
space:
mode:
Diffstat (limited to '.hammerspoon')
-rw-r--r--.hammerspoon/hyper.lua26
-rw-r--r--.hammerspoon/init.lua3
2 files changed, 18 insertions, 11 deletions
diff --git a/.hammerspoon/hyper.lua b/.hammerspoon/hyper.lua
index 2124bca..4cca4db 100644
--- a/.hammerspoon/hyper.lua
+++ b/.hammerspoon/hyper.lua
@@ -1,23 +1,27 @@
local hyper = hs.hotkey.modal.new({}, nil)
hyper.pressed = function()
- hyper:enter()
+ hyper:enter()
end
hyper.released = function()
- hyper:exit()
+ hyper:exit()
end
--- Bind the Hyper key to the hammerspoon modal
-hs.hotkey.bind({}, "F13", hyper.pressed, hyper.released)
+-- Hyper mode needs to be bound to a key. Here we are binding
+-- it to F17, because this is yet another key that's unused.
+-- Why not F18? We will use key-events from F18 to turn hyper
+-- mode on and off. Using F17 as both the modal and source of key
+-- events will result in a very jittery Hyper mode.
+hs.hotkey.bind({}, "F18", 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)
+ local fn = function()
+ hs.application.launchOrFocus(app)
+ end
+ if type(app) == "function" then
+ fn = app
+ end
+ hyper:bind(mods, key, fn)
end
return hyper
diff --git a/.hammerspoon/init.lua b/.hammerspoon/init.lua
index b8b7e84..f4ee5d1 100644
--- a/.hammerspoon/init.lua
+++ b/.hammerspoon/init.lua
@@ -5,3 +5,6 @@ hyper.bindApp({}, "w", "Warp")
hyper.bindApp({}, "s", "Slack")
hyper.bindApp({}, "1", "1Password")
hyper.bindApp({}, "r", "Rize")
+hyper.bindApp({}, "d", "Obsidian")
+hyper.bindApp({}, "c", "Google Chrome")
+hyper.bindApp({}, "t", "Notification Center")