Created
December 11, 2018 13:36
-
-
Save matbrady/f761f6e3d65f7fd3f16d0bdb04cef40b to your computer and use it in GitHub Desktop.
Hammerspoon Config
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Use Cmd+\ to show 1Password everywhere except Visual Studio Code and Atom | |
function activate_1password() | |
local client = hs.application.frontmostApplication() | |
local log = hs.logger.new('mymodule','debug') | |
log.i(client:title()) | |
if client:title() == 'Code' then | |
hs.eventtap.keyStroke({"cmd"}, "f10") | |
elseif client:title() == 'Atom' then | |
hs.eventtap.keyStroke({"cmd"}, "f11") | |
else | |
hs.eventtap.keyStroke({"cmd"}, "f12") | |
end | |
end | |
hs.hotkey.bind({"cmd"}, "\\", activate_1password) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment