-
Notifications
You must be signed in to change notification settings - Fork 0
/
apps.lua
19 lines (18 loc) · 861 Bytes
/
apps.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
local function toggleApplication(name)
local app = hs.application.find(name)
if not app or app:isHidden() then
hs.application.launchOrFocus(name)
elseif hs.application.frontmostApplication() ~= app then
app:activate()
else
app:hide()
end
end
hs.hotkey.bind(mash, "c", function() toggleApplication("Google Chrome") end)
hs.hotkey.bind(mash, "e", function() toggleApplication("Visual Studio Code") end)
hs.hotkey.bind(mash, "f", function() toggleApplication("Finder") end)
hs.hotkey.bind(mash, "g", function() toggleApplication("SourceTree") end)
hs.hotkey.bind(mash, "m", function() toggleApplication("Mail") end)
hs.hotkey.bind(mash, "p", function() toggleApplication("System Preferences") end)
hs.hotkey.bind(mash, "s", function() toggleApplication("Spotify") end)
hs.hotkey.bind(mash, "t", function() toggleApplication("Terminal") end)