mirror of
https://github.com/vale981/doom-modeline
synced 2025-03-06 01:31:41 -05:00
Suppress some segments when the window is small.
This commit is contained in:
parent
ae2862a033
commit
538017a399
1 changed files with 21 additions and 11 deletions
|
@ -1467,7 +1467,6 @@ Requires `eyebrowse-mode' or `tab-bar-mode' to be enabled."
|
||||||
(setq doom-modeline--persp-name
|
(setq doom-modeline--persp-name
|
||||||
;; Support `persp-mode', while not support `perspective'
|
;; Support `persp-mode', while not support `perspective'
|
||||||
(when (and doom-modeline-persp-name
|
(when (and doom-modeline-persp-name
|
||||||
(not doom-modeline--limited-width-p)
|
|
||||||
(bound-and-true-p persp-mode)
|
(bound-and-true-p persp-mode)
|
||||||
(fboundp 'safe-persp-name)
|
(fboundp 'safe-persp-name)
|
||||||
(fboundp 'get-current-persp))
|
(fboundp 'get-current-persp))
|
||||||
|
@ -1484,8 +1483,8 @@ Requires `eyebrowse-mode' or `tab-bar-mode' to be enabled."
|
||||||
(when (or doom-modeline-display-default-persp-name
|
(when (or doom-modeline-display-default-persp-name
|
||||||
(not (string-equal persp-nil-name name)))
|
(not (string-equal persp-nil-name name)))
|
||||||
(concat (doom-modeline-spc)
|
(concat (doom-modeline-spc)
|
||||||
(propertize (concat (when doom-modeline-persp-icon
|
(propertize (concat (and doom-modeline-persp-icon
|
||||||
(concat icon (doom-modeline-vspc)))
|
(concat icon (doom-modeline-vspc)))
|
||||||
(propertize name 'face face))
|
(propertize name 'face face))
|
||||||
'help-echo "mouse-1: Switch perspective
|
'help-echo "mouse-1: Switch perspective
|
||||||
mouse-2: Show help for minor mode"
|
mouse-2: Show help for minor mode"
|
||||||
|
@ -1507,8 +1506,9 @@ mouse-2: Show help for minor mode"
|
||||||
|
|
||||||
(doom-modeline-def-segment persp-name
|
(doom-modeline-def-segment persp-name
|
||||||
"The current perspective name."
|
"The current perspective name."
|
||||||
(if (doom-modeline--active)
|
(when (and (doom-modeline--active)
|
||||||
doom-modeline--persp-name))
|
(not doom-modeline--limited-width-p))
|
||||||
|
doom-modeline--persp-name))
|
||||||
|
|
||||||
|
|
||||||
;;
|
;;
|
||||||
|
@ -1518,8 +1518,9 @@ mouse-2: Show help for minor mode"
|
||||||
(doom-modeline-def-segment misc-info
|
(doom-modeline-def-segment misc-info
|
||||||
"Mode line construct for miscellaneous information.
|
"Mode line construct for miscellaneous information.
|
||||||
By default, this shows the information specified by `global-mode-string'."
|
By default, this shows the information specified by `global-mode-string'."
|
||||||
(if (doom-modeline--active)
|
(when (and (doom-modeline--active)
|
||||||
'("" mode-line-misc-info)))
|
(not doom-modeline--limited-width-p))
|
||||||
|
'("" mode-line-misc-info)))
|
||||||
|
|
||||||
|
|
||||||
;;
|
;;
|
||||||
|
@ -1608,6 +1609,7 @@ mouse-1: Display Line and Column Mode Menu"
|
||||||
(doom-modeline-def-segment parrot
|
(doom-modeline-def-segment parrot
|
||||||
"The party parrot animated icon. Requires `parrot-mode' to be enabled."
|
"The party parrot animated icon. Requires `parrot-mode' to be enabled."
|
||||||
(when (and (doom-modeline--active)
|
(when (and (doom-modeline--active)
|
||||||
|
(not doom-modeline--limited-width-p)
|
||||||
(bound-and-true-p parrot-mode))
|
(bound-and-true-p parrot-mode))
|
||||||
(concat (doom-modeline-spc)
|
(concat (doom-modeline-spc)
|
||||||
(doom-modeline-spc)
|
(doom-modeline-spc)
|
||||||
|
@ -1945,7 +1947,8 @@ mouse-1: Start server"))
|
||||||
|
|
||||||
(doom-modeline-def-segment lsp
|
(doom-modeline-def-segment lsp
|
||||||
"The LSP server state."
|
"The LSP server state."
|
||||||
(when doom-modeline-lsp
|
(when (and doom-modeline-lsp
|
||||||
|
(not doom-modeline--limited-width-p))
|
||||||
(let ((active (doom-modeline--active))
|
(let ((active (doom-modeline--active))
|
||||||
(icon (cond ((bound-and-true-p lsp-mode)
|
(icon (cond ((bound-and-true-p lsp-mode)
|
||||||
doom-modeline--lsp)
|
doom-modeline--lsp)
|
||||||
|
@ -2026,6 +2029,7 @@ Example:
|
||||||
"The GitHub notifications."
|
"The GitHub notifications."
|
||||||
(when (and doom-modeline-github
|
(when (and doom-modeline-github
|
||||||
(doom-modeline--active)
|
(doom-modeline--active)
|
||||||
|
(not doom-modeline--limited-width-p)
|
||||||
(numberp doom-modeline--github-notification-number)
|
(numberp doom-modeline--github-notification-number)
|
||||||
(> doom-modeline--github-notification-number 0))
|
(> doom-modeline--github-notification-number 0))
|
||||||
(concat
|
(concat
|
||||||
|
@ -2165,7 +2169,8 @@ mouse-1: Toggle Debug on Quit"
|
||||||
|
|
||||||
(doom-modeline-def-segment debug
|
(doom-modeline-def-segment debug
|
||||||
"The current debug state."
|
"The current debug state."
|
||||||
(when (doom-modeline--active)
|
(when (and (doom-modeline--active)
|
||||||
|
(not doom-modeline--limited-width-p))
|
||||||
(let* ((dap doom-modeline--debug-dap)
|
(let* ((dap doom-modeline--debug-dap)
|
||||||
(edebug (doom-modeline--debug-edebug))
|
(edebug (doom-modeline--debug-edebug))
|
||||||
(on-error (doom-modeline--debug-on-error))
|
(on-error (doom-modeline--debug-on-error))
|
||||||
|
@ -2207,6 +2212,7 @@ mouse-1: Toggle Debug on Quit"
|
||||||
"Show notifications of any unread emails in `mu4e'."
|
"Show notifications of any unread emails in `mu4e'."
|
||||||
(when (and doom-modeline-mu4e
|
(when (and doom-modeline-mu4e
|
||||||
(doom-modeline--active)
|
(doom-modeline--active)
|
||||||
|
(not doom-modeline--limited-width-p)
|
||||||
(bound-and-true-p mu4e-alert-mode-line)
|
(bound-and-true-p mu4e-alert-mode-line)
|
||||||
(numberp mu4e-alert-mode-line)
|
(numberp mu4e-alert-mode-line)
|
||||||
;; don't display if the unread mails count is zero
|
;; don't display if the unread mails count is zero
|
||||||
|
@ -2297,6 +2303,7 @@ mouse-1: Toggle Debug on Quit"
|
||||||
(doom-modeline-def-segment gnus
|
(doom-modeline-def-segment gnus
|
||||||
"Show notifications of any unread emails in `gnus'."
|
"Show notifications of any unread emails in `gnus'."
|
||||||
(when (and (doom-modeline--active)
|
(when (and (doom-modeline--active)
|
||||||
|
(not doom-modeline--limited-width-p)
|
||||||
doom-modeline-gnus
|
doom-modeline-gnus
|
||||||
doom-modeline--gnus-started
|
doom-modeline--gnus-started
|
||||||
;; Don't display if the unread mails count is zero
|
;; Don't display if the unread mails count is zero
|
||||||
|
@ -2389,7 +2396,8 @@ to be an icon and we don't want to remove that so we just return the original."
|
||||||
(doom-modeline-def-segment irc-buffers
|
(doom-modeline-def-segment irc-buffers
|
||||||
"The list of shortened, unread irc buffers."
|
"The list of shortened, unread irc buffers."
|
||||||
(when (and doom-modeline-irc
|
(when (and doom-modeline-irc
|
||||||
(doom-modeline--active))
|
(doom-modeline--active)
|
||||||
|
(not doom-modeline--limited-width-p))
|
||||||
(let* ((buffers (doom-modeline--get-buffers))
|
(let* ((buffers (doom-modeline--get-buffers))
|
||||||
(number (length buffers)))
|
(number (length buffers)))
|
||||||
(when (> number 0)
|
(when (> number 0)
|
||||||
|
@ -2401,7 +2409,8 @@ to be an icon and we don't want to remove that so we just return the original."
|
||||||
(doom-modeline-def-segment irc
|
(doom-modeline-def-segment irc
|
||||||
"A notification icon for any unread irc buffer."
|
"A notification icon for any unread irc buffer."
|
||||||
(when (and doom-modeline-irc
|
(when (and doom-modeline-irc
|
||||||
(doom-modeline--active))
|
(doom-modeline--active)
|
||||||
|
(not doom-modeline--limited-width-p))
|
||||||
(let* ((buffers (doom-modeline--get-buffers))
|
(let* ((buffers (doom-modeline--get-buffers))
|
||||||
(number (length buffers)))
|
(number (length buffers)))
|
||||||
(when (> number 0)
|
(when (> number 0)
|
||||||
|
@ -2543,6 +2552,7 @@ mouse-3: Switch to next unread buffer")))
|
||||||
(doom-modeline-def-segment battery
|
(doom-modeline-def-segment battery
|
||||||
"Display battery status."
|
"Display battery status."
|
||||||
(when (and (doom-modeline--active)
|
(when (and (doom-modeline--active)
|
||||||
|
(not doom-modeline--limited-width-p)
|
||||||
(bound-and-true-p display-battery-mode))
|
(bound-and-true-p display-battery-mode))
|
||||||
(concat (doom-modeline-spc)
|
(concat (doom-modeline-spc)
|
||||||
(concat
|
(concat
|
||||||
|
|
Loading…
Add table
Reference in a new issue