Skip to content

Instantly share code, notes, and snippets.

@Zert
Created August 31, 2016 08:40
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save Zert/cfd9daa3786428a7bd4a1bfd62f7320a to your computer and use it in GitHub Desktop.
local application = require "mjolnir.application"
local hotkey = require "mjolnir.hotkey"
local window = require "mjolnir.window"
local fnutils = require "mjolnir.fnutils"
-- Set up hotkey combinations
local cmct = {"cmd", "ctrl"}
function switch_fun(name)
local first_attempt = application.launchorfocus(name)
if not first_attempt then
application.launchorfocus(name)
end
end
local z_bind =
function(bd)
hotkey.bind(cmct, bd[1], function() switch_fun(bd[2]) end)
end
local z_binds = {
{'i', 'iTerm'},
{'e', 'Emacs'},
{'c', 'Google Chrome'},
{'a', 'Airmail 3'},
{'j', 'Adium'},
{'s', 'Skype'},
{'f', 'Finder'},
--{'v', 'VK Play'},
{'b', 'Safari'},
{'t', 'TweetDeck'},
{'l', 'nvALT'},
--{'d', 'Dash'},
{'r', 'Reditr'},
{'m', 'Spotify'},
{'g', 'Telegram'},
{'x', 'Xcode'},
--{'m', 'Deezer'},
--{'o', 'OmniGraffle'},
--{'k', 'Keynote'},
}
fnutils.map(z_binds, z_bind)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment