Skip to content

Instantly share code, notes, and snippets.

@tonsky
Created November 10, 2021 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tonsky/647a9e0c625eaef35695029d15ea2988 to your computer and use it in GitHub Desktop.
Save tonsky/647a9e0c625eaef35695029d15ea2988 to your computer and use it in GitHub Desktop.
Hammerspoon config to toggle keyboard layouts
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