by 0rca · 3y ago · 0 comments
-- ~/.hammerspoon/init.lua
function define_shortcut(appName, key, mod)
hs.hotkey.bind(mod, key, function()
hs.application.enableSpotlightForNameSearches(true)
local app = hs.application.find(appName)
if app and app:isFrontmost() then
app:hide()
else
hs.application.open(appName)
end
end)
end
define_shortcut("Alacritty", "F1", {})
define_shortcut("Firefox", "F2", {})No comments yet.