fix(tools/emacs): Configure xkb switching shortcuts on EXWM launch

This enables half of the shortcuts for switching keyboard languages
when EXWM launches.

The cyrillic ones are commented out because Emacs doesn't start
otherwise, I've no idea why and don't care at the moment.
This commit is contained in:
Vincent Ambo 2020-05-16 03:54:44 +01:00
parent dd7e5e0377
commit a078cabc71

View file

@ -139,21 +139,25 @@
(exwm-input-set-key (kbd "<XF86MonBrightnessUp>") #'brightness-up) (exwm-input-set-key (kbd "<XF86MonBrightnessUp>") #'brightness-up)
(exwm-input-set-key (kbd "<XF86Display>") #'lock-screen) (exwm-input-set-key (kbd "<XF86Display>") #'lock-screen)
;; Keyboard layouts (these are bound separately in Cyrillic ;; Shortcuts for switching between keyboard layouts
;; because I don't use reverse-im) (defmacro bind-xkb (lang key)
;; (-map `(exwm-input-set-key (kbd (format "s-%s" ,key))
;; (lambda (pair) (lambda ()
;; (exwm-input-set-key (interactive)
;; (kbd (format "s-%s" (cadr pair))) (set-xkb-layout ,lang))))
;; `(lambda () (interactive) (set-xkb-layout ,(car pair)))))
;; '(("de" "k d") (bind-xkb "us" "k u")
;; ("de" "л в") (bind-xkb "de" "k d")
;; ("no" "k n") (bind-xkb "no" "k n")
;; ("no" "л т") (bind-xkb "ru" "k r")
;; ("ru" "k r")
;; ("ru" "л к") ;; These are commented out because Emacs no longer starts (??) if
;; ("us" "k u") ;; they're set at launch.
;; ("us" "л г"))) ;;
;; (bind-xkb "us" "л г")
;; (bind-xkb "de" "л в")
;; (bind-xkb "no" "л т")
;; (bind-xkb "ru" "л к")
;; Line-editing shortcuts ;; Line-editing shortcuts
(exwm-input-set-simulation-keys (exwm-input-set-simulation-keys