Update modeline display for perspective/eyebrowse

This commit is contained in:
Wojciech Kozlowski 2018-07-10 08:27:42 +01:00
parent bf6c502072
commit 98bf6ba79e
2 changed files with 22 additions and 6 deletions

View File

@ -41,19 +41,32 @@
(setq-default doom-modeline-height 23)
;; Add perspective to modeline
(doom-modeline-def-segment perspectives
(doom-modeline-def-segment perspective-name
"Perspectives list and selection. Requires `persp-mode' to be enabled."
(if (and (bound-and-true-p persp-mode)
(< 1 (hash-table-count (perspectives-hash))))
(persp-mode-line)
(if (bound-and-true-p persp-mode)
(persp-format-name (persp-name (persp-curr)))
""))
(declare-function doom-modeline-segment--perspective-name "em-modeline")
(doom-modeline-def-segment workspace-number
"The current workspace name or number. Requires `eyebrowse-mode' to be
enabled."
(if (bound-and-true-p eyebrowse-mode)
(let* ((num (eyebrowse--get 'current-slot))
(tag (when num (nth 2 (assoc num (eyebrowse--get 'window-configs)))))
(str (if (and tag (< 0 (length tag)))
tag
(when num (int-to-string num)))))
(format ":%s" (propertize str 'face 'doom-modeline-eyebrowse)))
""))
(declare-function doom-modeline-segment--perspectives "em-modeline")
;; Set the modeline
(doom-modeline-def-modeline main
(perspectives
("["
perspective-name
workspace-number
"]"
bar
matches
" "

View File

@ -436,6 +436,9 @@
;; perspective
`(persp-selected-face ((t (:weight bold :foreground ,*head1*))))
;; doom modeline
`(doom-modeline-eyebrowse ((t (:weight bold :foreground ,*string*))))
)
;; Define values for colours that don't use faces.