diff options
Diffstat (limited to 'lisp/my-header-line.el')
| -rw-r--r-- | lisp/my-header-line.el | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/lisp/my-header-line.el b/lisp/my-header-line.el index fdce633..cbe1285 100644 --- a/lisp/my-header-line.el +++ b/lisp/my-header-line.el @@ -70,13 +70,24 @@ Matches the default height of Dirvish's full-frame header line." "Quiet face for the scroll percentage and cursor position.") (defface my/header-line-workspace-active-face - '((t (:inherit my/header-line-position-face :inverse-video nil :box nil))) - "Current workspace, styled like the percentage and cursor position.") + '((t (:inherit font-lock-keyword-face :weight normal :inverse-video nil :box nil))) + "Theme keyword accent for the current workspace, matching the Evil state tag.") (defface my/header-line-workspace-inactive-face '((t (:inherit shadow :weight normal :slant normal))) "Quiet numbers for other open workspaces.") +(defface my/header-line-badge-face + '((t (:inherit font-lock-function-name-face :weight normal))) + "Theme function accent for the personal badge icon.") + +(defcustom my/header-line-badge-icon nil + "Nerd icon shown at the very start of the header line. +A Material Design icon name as understood by `nerd-icons-mdicon', +for example \"nf-md-hexagon_outline\". Nil hides the segment." + :type '(choice (const :tag "No badge" nil) (string :tag "Icon name")) + :group 'mode-line) + (defvar my/header-line-workspaces-expanded nil "Whether the header line also shows the other open workspaces.") @@ -162,6 +173,13 @@ the project root, falling back to the plain buffer name." (face (or (nth 2 entry) 'my/header-line-evil-normal))) (propertize (format " %s " tag) 'face face)))) +(defun my/header-line-badge () + "Render `my/header-line-badge-icon', or nothing when it is unset." + (if my/header-line-badge-icon + (concat " " (my/header-line--icon my/header-line-badge-icon + 'my/header-line-badge-face)) + "")) + (defun my/header-line-buffer-state () "Render a clean lock, edit, or saved indicator for the current buffer." (cond @@ -356,7 +374,8 @@ headings, remain visible." (list '(:eval (my/header-line--height-spacer)) (my/header-line--make - '((:eval (my/header-line-evil-state)) " " + '((:eval (my/header-line-badge)) + (:eval (my/header-line-evil-state)) " " (:eval (my/header-line-buffer-state)) (:eval (my/header-line-remote)) " " (:eval (my/header-line-buffer-icon)) " " |
