helm/hammerspoon/apps.lua

20 lines
670 B
Lua
Raw Normal View History

2015-12-23 21:21:18 -08:00
forApp("Finder", function (appName, eventType, appObject)
-- Bring all Finder windows forward when one gets activated
appObject:selectMenuItem({"Window", "Bring All to Front"})
end)
forApp("iTerm2", function (appName, _, appObject)
-- cmd+N switch-to-window shortcuts in Tmux
for i = 1,9 do
i = tostring(i)
bind(appName, 'cmd', i, function ()
if string.find(appObject:focusedWindow():title(), ".*tmux") then
-- os.execute("/usr/local/bin/tmux select-window -t " .. i)
hs.eventtap.keyStroke({'ctrl'}, 'c')
hs.eventtap.keyStroke({}, i)
end
end)
end
end)