Tue, 18 Jul 2017 21:34:12 -0400
housekeeping
.hammerspoon/init.lua | file | annotate | diff | comparison | revisions |
--- a/.hammerspoon/init.lua +++ b/.hammerspoon/init.lua @@ -1,20 +1,20 @@ hs.window.animationDuration = 0 -function reloadConfig(files) - hs.reload() -end -hs.pathwatcher.new(os.getenv("HOME") .. "/.hammerspoon/", reloadConfig):start() +-- set up reload on modify +hs.pathwatcher.new(os.getenv("HOME") .. "/.hammerspoon/", hs.reload):start() +-- aliases and partial bindings to make life easier local bindKey = hs.hotkey.bind local cmd = hs.fnutils.partial(bindKey, {"cmd"}) local cmdShift = hs.fnutils.partial(bindKey, {"cmd", "shift"}) local cmdCtrl = hs.fnutils.partial(bindKey, {"cmd", "ctrl"}) -cmdShift('r', reloadConfig) - function focusedWindow() return hs.window.focusedWindow() or hs.window.desktop() end function focusTo(direction) hs.window['focusWindow' .. direction](focusedWindow()) end +-- and the key bindings +cmdShift('r', hs.reload) + cmd('k', function () focusTo('North') end) cmd('up', function () focusTo('North') end)