Created
August 31, 2016 08:40
Star
You must be signed in to star a gist
This file contains 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
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