Skip to content

Instantly share code, notes, and snippets.

@matbrady
Created December 11, 2018 13:36
Show Gist options
  • Save matbrady/f761f6e3d65f7fd3f16d0bdb04cef40b to your computer and use it in GitHub Desktop.
Save matbrady/f761f6e3d65f7fd3f16d0bdb04cef40b to your computer and use it in GitHub Desktop.
Hammerspoon Config
-- 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