summaryrefslogtreecommitdiffstats
path: root/hammerspoon/init.lua
diff options
context:
space:
mode:
Diffstat (limited to 'hammerspoon/init.lua')
-rw-r--r--hammerspoon/init.lua29
1 files changed, 29 insertions, 0 deletions
diff --git a/hammerspoon/init.lua b/hammerspoon/init.lua
new file mode 100644
index 0000000..c6b2b73
--- /dev/null
+++ b/hammerspoon/init.lua
@@ -0,0 +1,29 @@
+hs.loadSpoon("ReloadConfiguration")
+spoon.ReloadConfiguration:start()
+
+hs.loadSpoon("SpeedMenu")
+
+hs.hotkey.bind({"alt"}, "h", function()
+ hs.window.focusedWindow():focusWindowWest(nil, false, true)
+end)
+hs.hotkey.bind({"alt"}, "j", function()
+ hs.window.focusedWindow():focusWindowSouth(nil, false, true)
+end)
+hs.hotkey.bind({"alt"}, "k", function()
+ hs.window.focusedWindow():focusWindowNorth(nil, false, true)
+end)
+hs.hotkey.bind({"alt"}, "l", function()
+ hs.window.focusedWindow():focusWindowEast(nil, false, true)
+end)
+
+menubar = hs.menubar.new()
+timer = hs.timer.doEvery(1, function()
+ hs.host.cpuUsage(function(cpu)
+ local cpuUsage = cpu["overall"]["active"]
+ menubar:setTitle(math.floor(cpuUsage + 0.5) .. "%")
+ end)
+end)
+
+hs.caffeinate.set("systemIdle", true, true)
+
+hs.alert("Hammerspoon config reloaded")