Created
July 10, 2015 14:14
-
-
Save STRML/96adae1c6c3757d35f74 to your computer and use it in GitHub Desktop.
Revisions
-
STRML created this gist
Jul 10, 2015 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,29 @@ -- -- Fix Slack's channel switching. -- This rebinds ctrl-tab and ctrl-shift-tab back to switching channels, -- which is what they did before the Teams update. -- -- Slack only provides alt+up/down for switching channels, (and the cmd-t switcher, -- which is buggy) and have 3 (!) shortcuts for switching teams, most of which are -- the usual tab switching shortcuts in every other app. -- local ctrlTab = hotkey.new({"ctrl"}, "tab", function() hs.eventtap.keyStroke({"alt"}, "Down") end) local ctrlShiftTab = hotkey.new({"ctrl", "shift"}, "tab", function() hs.eventtap.keyStroke({"alt"}, "Up") end) slackWatcher = hs.application.watcher.new(function(name, eventType, app) if eventType ~= hs.application.watcher.activated then return end if name == "Slack" then ctrlTab:enable() ctrlShiftTab:enable() else ctrlTab:disable() ctrlShiftTab:disable() end end) -- If you re-init config often, be sure to stop() this before starting or you will -- have multiple application watchers running at once. slackWatcher.start()