Created
November 10, 2021 13:57
-
-
Save tonsky/647a9e0c625eaef35695029d15ea2988 to your computer and use it in GitHub Desktop.
Hammerspoon config to toggle keyboard layouts
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
require("hs.hotkey") | |
require("hs.keycodes") | |
hs.hotkey.bind({}, "F13", function() | |
-- hs.keycodes.currentSourceID("me.tonsky.keyboardlayout.helix.english-helix") | |
hs.keycodes.setLayout("English - Helix") | |
end) | |
hs.hotkey.bind({}, "F14", function() | |
-- hs.keycodes.currentSourceID("me.tonsky.keyboardlayout.helix.russian-helix") | |
hs.keycodes.setLayout("Russian - Helix") | |
end) | |
hs.hotkey.bind({}, "F15", function() | |
hs.keycodes.currentSourceID("com.apple.keylayout.ABC") | |
end) | |
hs.hotkey.bind({}, "F16", function() | |
hs.keycodes.currentSourceID("com.apple.keylayout.RussianWin") | |
end) | |
hs.hotkey.bind({}, "F17", function() | |
hs.keycodes.currentSourceID("me.tonsky.keyboardlayout.levinson.english-levinson") | |
end) | |
hs.hotkey.bind({}, "F18", function() | |
hs.keycodes.currentSourceID("me.tonsky.keyboardlayout.levinson.russian-levinson") | |
end) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment