seagle0128 / doom-modeline

A fancy and fast mode-line inspired by minimalism design.
https://seagle0128.github.io/doom-modeline/
GNU General Public License v3.0
1.26k stars 153 forks source link

Support specifying both header-line and mode-line independently #322

Open evertedsphere opened 4 years ago

evertedsphere commented 4 years ago

Describe the solution you'd like

Something like:

(doom-modeline-def-modeline 'my-simple-line
  ... ...)

(doom-modeline-def-headerline 'my-simple-headerline
  ... ...)

(defun setup-custom-doom-lines ()
   (doom-modeline-set-modeline 'my-simple-modeline 'default)
   (doom-modeline-set-headerline 'my-simple-headerline 'default))
(add-hook 'doom-modeline-mode-hook 'setup-custom-doom-lines)

Describe alternatives you've considered

I've tried hacking this in myself, e.g. in Doom Emacs with (package! doom-modeline) (and without the modeline module), I attempted to first make a setup with a headerline and no modeline:


(use-package! doom-modeline
  :config
  (setq doom-modeline-icon nil)

  (doom-modeline-def-modeline
    'evsph/modeline
    `(
      ,(propertize "❈" 'face 'doom-modeline-urgent)
      buffer-info buffer-position remote-host
      minor-modes major-mode
      process vcs lsp checker))

  (setq-default header-line-format
                (list "%e"
                      '(:eval (doom-modeline-format--evsph/modeline)))))

which kind of works but doesn't react to things like my recording evil macros or generally anything hook-dependent, I guess. I'm very new to Emacs so I'm not sure how to work with advice and such.

Additional context Add any other context or screenshots about the feature request here.

seagle0128 commented 4 years ago

doom-modeline is designed for beautifying the mode-line, while not header-line. I don't know what do you want to do exactly? Maybe you can provide some examples.

Well, since the formats of mode-line and header-line are the same, you are definitely able to define the mode-line and set to the header-line, including recording evil macros or something like that. e.g. (setq-default header-line-format (doom-modeline-set-main-modeline)). What you need to do is defining the segment and modeline.

evertedsphere commented 4 years ago

Here is what I have now:

image

I've put a few static (i.e. not reacting to things like changes of Evil state) segments in my header-line: date, time, and currently playing (using libmpdel).

https://github.com/evertedsphere/.doom.d/blob/255af27839e5af9a34c7c54e757cf444055908ef/config.el#L42

evertedsphere commented 4 years ago

Basically, I'd like some way for doom-modeline to support beautification of the header-line as well. :)

seagle0128 commented 4 years ago

matches segment is for searching and anzu, etc.