about summary refs log tree commit diff
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2018-06-14T23·32+0200
committerVincent Ambo <mail@tazj.in>2018-06-14T23·32+0200
commite743ea28c50ffd8a702b943260f05cbeee642bcc (patch)
tree41e4e8f77d21f93351b0b2ff14527eb29c641b99
parent9da46061627196c977c69a8d84f9023c47640f75 (diff)
feat(look-and-feel): Display EXWM workspace index in mode-line
Been waiting to do this since forever!
-rw-r--r--init/look-and-feel.el8
1 files changed, 7 insertions, 1 deletions
diff --git a/init/look-and-feel.el b/init/look-and-feel.el
index 0a7c21c2d86a..555feca43fcf 100644
--- a/init/look-and-feel.el
+++ b/init/look-and-feel.el
@@ -49,6 +49,11 @@
 (telephone-line-defsegment telephone-line-last-window-segment ()
   (telephone-misc-if-last-window))
 
+;; Display the current EXWM workspace index in the mode-line
+(telephone-line-defsegment telephone-line-exwm-workspace-index ()
+  (when (bottom-right-window-p)
+    (format "[%s]" exwm-workspace-current-index)))
+
 ;; Define a highlight font for ~ important ~ information in the last
 ;; window.
 (defface special-highlight '((t (:foreground "white" :background "#5f627f"))) "")
@@ -61,7 +66,8 @@
 
 (setq telephone-line-rhs
       '((accent . (telephone-line-major-mode-segment))
-        (nil . (telephone-line-last-window-segment))
+        (nil . (telephone-line-last-window-segment
+                telephone-line-exwm-workspace-index))
         (highlight . (telephone-line-notmuch-counts))))
 
 (setq telephone-line-primary-left-separator 'telephone-line-tan-left