domtronn / spaceline-all-the-icons.el

A Spaceline Mode Line theme using All The Icons for Emacs
MIT License
235 stars 25 forks source link

Customise location of certain widgets #13

Open domtronn opened 7 years ago

domtronn commented 7 years ago

(Quoted from @jwintz #7)

Also, If I ike your HUD segment, I would like to customise it to be on the right-most place, as it is done in spaceline default setup (I do not use Spacemacs, which is however awesome). ... Could it also be possible to have buffer current position (line and column segment) on the right ?

domtronn commented 7 years ago

Spaceline lets you define your own mode line themes, and Spaceline All The Icons provides all the segments, so it's possible to move the segments and make a new one, but I appreciate that's super verbose since you'd have to redefine the entire theme! e.g.

(spaceline-compile
 "all-the-icons"
 '((all-the-icons-anzu
    :face mode-line
    :skip-alternate t)

;; ... etc ...

    :face powerline-active2)

   all-the-icons-separator-right-active-1
   ((all-the-icons-position
     all-the-icons-buffer-position)   ;; MOVED
    :separator " " :when active)

   all-the-icons-separator-right-active-2
   all-the-icons-separator-right-inactive

   ((all-the-icons-battery-status
     all-the-icons-time
     all-the-icons-hud)         ;; MOVED
    :separator (spaceline-all-the-icons--separator "|" " ") :face default-face)))

The only difficulty with this feature is what segments you allow to be placed on the left and right, because you'd have to start wrapping the segment in things like

((all-the-icons-hud) :when (eq hud-segment-position 'left))
;; ... rest ...
((all-the-icons-hud) :when (eq hud-segment-position 'right))

Which basically means duplicating most of the segment definitions... And it also mucks around with separators 😕

I like the idea of this because I'd like users to feel like they can easily modify and customise this, but I image the best mechanism to do this is to redefine the theme... 😞

Do you have any ideas/thoughts?

jwintz commented 7 years ago

Humm, not really, the point to using spaceline-all-the-icons is to have a fully featured modeline without having to define your own. Also I'd rather like to contribute than fork. So let's keep things as they are. Anyway, after some days of usage, I'm already used to it ;-)

seanfarley commented 7 years ago

I just found out that you made a package out of this (cool!) but I am in the camp of having already defined a bunch of custom segments (offlineimap, mercurial, erc, etc.) I guess I'm blocked by this issue if I want to define a different order than the default one?

domtronn commented 7 years ago

@seanfarley It's all built on top of spaceline, so you're free to define your own theme and use a mixture of my segments and your custom ones, but I appreciate that can be a pain to maintain 😅

There's an alternative that you can define additional segments when loading the theme, e.g.

(spaceline-all-the-icons-theme 'your-segment)

But this (at the moment) will only load them on the right hand side so you don't get full control over their order... I'm also heavily looking into #46 which is battling against the new "responsive" behaviour of spaceline, which makes it harder to decide what to show 😕

Also, I'm more than willing to accept Issues/PRs/Ideas for new segments if you think other people could benefit from them 👍

seanfarley commented 7 years ago

Thanks for the explanation :-) I had not seen #46 ... which is a definite bummer (I agree with your sentiment there).

As for contributing the segments: sure! I should probably clean them up first, though (and make sure I'm not using any custom / local hacks!)

seanfarley commented 6 years ago

Just wanted to touch base here and see if the status has changed. I see #46 has been closed; does that help move this issue along?