[hammerspoon] Sigh, escaping in fullscreen Safari

pull/28/head
Alpha Chen 9 years ago
parent 935ef48c33
commit 29371bb36b

@ -7,13 +7,13 @@ end
-- Application shortcuts
local safari_esc = hs.hotkey.new({}, "escape", function() end, function()
if current_app():name() == "Safari" then
hs.eventtap.keyStroke({"alt"}, "escape")
end
end)
-- local safari_esc = hs.hotkey.new({}, "escape", function() end, function()
-- if current_app():name() == "Safari" then
-- hs.eventtap.keyStroke({"alt"}, "escape")
-- end
-- end)
local safari_esc = hs.hotkey.new({"cmd"}, "w", function() end, function()
local safari_close_tab = hs.hotkey.new({"cmd"}, "w", function() end, function()
if current_app():name() == "Safari" then
current_app():selectMenuItem({"File", "Close Tab"})
end
@ -21,10 +21,10 @@ end)
local wf = hs.window.filter
wf.new("Safari"):subscribe(wf.windowFocused, function()
safari_esc:enable()
-- safari_esc:enable()
safari_close_tab:enable()
end):subscribe(wf.windowUnfocused, function()
safari_esc:disable()
-- safari_esc:disable()
safari_close_tab:disable()
end)

Loading…
Cancel
Save