emacs: add current exwm workspace number to mode-line
authorAmin Bandali <mab@gnu.org>
Sat, 14 Mar 2020 01:25:59 +0000 (21:25 -0400)
committerAmin Bandali <mab@gnu.org>
Sat, 14 Mar 2020 01:25:59 +0000 (21:25 -0400)
.emacs.d/init.el

index f2c5bff..e965e01 100644 (file)
   (setq b/emacs-initialized     t
         gc-cons-threshold       b/gc-cons-threshold
         gc-cons-percentage      b/gc-cons-percentage
   (setq b/emacs-initialized     t
         gc-cons-threshold       b/gc-cons-threshold
         gc-cons-percentage      b/gc-cons-percentage
-        file-name-handler-alist b/file-name-handler-alist))
+        file-name-handler-alist b/file-name-handler-alist)
+  (with-eval-after-load 'exwm-workspace
+    (setq-default
+     mode-line-format
+     (append
+      mode-line-format
+      '((:eval
+         (format
+          "[%s]" (number-to-string
+                  exwm-workspace-current-index))))))))
 (add-hook 'after-init-hook #'b/post-init)
 
 ;; increase number of lines kept in *Messages* log
 (add-hook 'after-init-hook #'b/post-init)
 
 ;; increase number of lines kept in *Messages* log