Skip to content

Instantly share code, notes, and snippets.

@LinArcX
Created January 21, 2022 16:55
Show Gist options
  • Save LinArcX/187204b635edb07ad298afa70f67f235 to your computer and use it in GitHub Desktop.
Save LinArcX/187204b635edb07ad298afa70f67f235 to your computer and use it in GitHub Desktop.
(defun linarcx-keyboard-layout (ml)
(declare (ignore ml))
(let ((cmd "xkb-switch -p"))
(string-trim '(#\Newline) (run-shell-command cmd t))))
(add-screen-mode-line-formatter #\L #'linarcx-keyboard-layout)
Also the output of: `(run-shell-command "xkb-switch -p"" t)` is:
"us
"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment