about summary refs log tree commit diff
path: root/users/tazjin/emacs/config/desktop.el
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2021-12-24T19·28+0300
committerclbot <clbot@tvl.fyi>2021-12-24T19·33+0000
commit1935b416207360aea523521c8abb240970e44fbe (patch)
tree3eb3c1b700630ac1bb725f136ed11dab13e8de5f /users/tazjin/emacs/config/desktop.el
parent15a9443e3668fc164b1a61095e6a5f22ae48f6f0 (diff)
feat(tazjin/emacs): Use Emacs input methods in X11 buffers r/3373
This is much easier than the shitty keyboard layout switcher which
caused all kinds of terrifying bugs.

Unfortunately the layout switcher remains additionally because this
doesn't work with Quassel (Qt dropped support for XIM).

Change-Id: I7c58cebf9391216b6e7134d8c283d52cb18332de
Reviewed-on: https://cl.tvl.fyi/c/depot/+/3497
Tested-by: BuildkiteCI
Autosubmit: tazjin <mail@tazj.in>
Reviewed-by: tazjin <mail@tazj.in>
Diffstat (limited to 'users/tazjin/emacs/config/desktop.el')
-rw-r--r--users/tazjin/emacs/config/desktop.el11
1 files changed, 9 insertions, 2 deletions
diff --git a/users/tazjin/emacs/config/desktop.el b/users/tazjin/emacs/config/desktop.el
index 3a4983f629..c160ae131f 100644
--- a/users/tazjin/emacs/config/desktop.el
+++ b/users/tazjin/emacs/config/desktop.el
@@ -4,13 +4,14 @@
 ;; window-management (EXWM) as well as additional system-wide
 ;; commands.
 
-(require 's)
-(require 'f)
 (require 'dash)
 (require 'exwm)
 (require 'exwm-config)
 (require 'exwm-randr)
 (require 'exwm-systemtray)
+(require 'exwm-xim )
+(require 'f)
+(require 's)
 
 (defcustom tazjin--screen-lock-command "tazjin-screen-lock"
   "Command to execute for locking the screen."
@@ -52,6 +53,7 @@
 (defun lock-screen ()
   (interactive)
   (set-xkb-layout "us")
+  (deactivate-input-method)
   (shell-command tazjin--screen-lock-command))
 
 (defun create-window-name ()
@@ -180,6 +182,11 @@
 (bind-xkb "no" "л т")
 (bind-xkb "ru" "л к")
 
+;; Configuration of EXWM input method handling for X applications
+(exwm-xim-enable)
+(setq default-input-method "russian-computer")
+(push ?\C-\\ exwm-input-prefix-keys)
+
 ;; Line-editing shortcuts
 (exwm-input-set-simulation-keys
  '(([?\C-d] . delete)