Skip to content

Instantly share code, notes, and snippets.

@tazjin
Created July 1, 2019 10:33
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 tazjin/a95bde12429e2c583ee41a1643f898fb to your computer and use it in GitHub Desktop.
Save tazjin/a95bde12429e2c583ee41a1643f898fb to your computer and use it in GitHub Desktop.
(defun set-xkb-layout (layout)
"Set the current X keyboard layout."
(shell-command (format "setxkbmap %s" layout))
(message "Set X11 keyboard layout to '%s'" layout))
(-map
(lambda (pair)
(exwm-input-set-key
(kbd (format "s-%s" (cadr pair)))
`(lambda () (interactive) (set-xkb-layout ,(car pair)))))
'(("no" "k n")
("no" "л т")
("ru" "k r")
("ru" "л к")
("us" "k u")
("us" "л г")))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment