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

Segments colours are messed up using custom themes #7

Closed jwintz closed 7 years ago

jwintz commented 7 years ago

Hello,

Great package ! Was waiting for it to get rid of my custom spaceline config ;-)

I've been giving a shot at your package, together with doom-theme-one.

They do not fit well, in that sense that segments are not coloured. Is there a specific face to set up ?

Also, I am quite surprised that projectile, and file name come as a single segment.

Finally, using doom-theme, the wave segment is not rendered correctly. I do not see anzu working whatsoever, and the clock icon is wrong. Here's the setup:

(use-package spaceline-all-the-icons
  :after spaceline
  :config
  (spaceline-all-the-icons-theme)
  (spaceline-all-the-icons--setup-anzu)
  (spaceline-all-the-icons--setup-package-updates)
  (spaceline-all-the-icons--setup-paradox)
  (spaceline-all-the-icons--setup-neotree)
  (setq spaceline-all-the-icons-flycheck-alternate t)
  (setq spaceline-all-the-icons-highlight-file-name t)
  (setq spaceline-all-the-icons-separator-type (quote wave)))
screen shot 2017-04-16 at 19 56 01

Cheers,

domtronn commented 7 years ago

Hi @jwintz, thanks! Good news, I can reproduce this myself 😅

w.r.t. the segment colours, yes, they use specific faces for each segment, these include

And since the wave separator is basically an icon, it calculates it's foreground and background colours from the two faces its transitioning between, e.g. from spaceline-highlight-face to powerline-active-1... The problem here, is that spaceline-highlight-face doesn't have a background property set on it, so when you call

(face-background 'spaceline-highlight-face)

It returns nil rather than the inherited background colour and so then defaults to inheriting the foreground colour, which is wrong!

w.r.t. the projectile/file-name segments, they're still separate segments 😃 they're just very coupled to try and produce a "smart" behaviour, that is,

And these are controlled by all-the-icons-projectile, all-the-icons-buffer-path and all-the-icons-buffer-id - You should be able to toggle these on and off independently to suit your taste and if you have any suggestions for the behaviour, I'm more than happy to hear them 😃

Lastly, I'm not sure why the Clock Icon isn't showing? Do you have weather-icons installed? What happens if you call all-the-icons-insert-icons-for-wicon inside a *scratch* buffer?

tl;dr Yep, from what I can tell from your set up, you will need to set spaceline-highlight-face & powerline-active2 to have background colours.

Try toggling spaceline-toggle-all-the-icons-projetcile, spaceline-toggle-all-the-icons-buffer-path and spaceline-toggle-all-the-icons-buffer-id on and off to see how the file path works

Please try calling all-the-icons-insert-icons-for-wicon inside a *scratch* buffer and screenshot the results?

domtronn commented 7 years ago

Also, I forgot to mention about anzu-mode... Do you have global-anzu-mode enabled? And what's the value of anzu-mode-line-update-function after your init? It could be that anzu is loading after spaceline-all-the-icons and therefore overwriting back to default...?

jwintz commented 7 years ago

@domtronn, many thanks for your prompt and very detailed answer. Also, sorry to bring so many different questions in a single ticket, that is no good usage :-(. Don't want to be itchy, but I feel this package is gonna grow in popularity and I want to stick with it and maybe help with some PR. I have not yet read all the code.

So let me address things point by point:

(spaceline-spacemacs-theme 'prolusion-mode-icon 'prolusion-narrow 'prolusion-conda-environment 'prolusion-upgrades-count)

Could it still be done with ?

(spaceline-all-the-icons-theme <ADDITIONAL SEGMENTS>)

Using doom-theme-one now anyway, I have set up the power line separator to (quote none), and I like it. Will investigate though.

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).

spaceline-toggle-all-the-icons-package-update-on

As for anzu, I have it globally enabled, and included before my ui config, but I found the fix: because of default spaceline's displaying twice, I had:

(setq anzu-cons-mode-line-p nil)

(global-anzu-mode +1)

which I changed to

(setq anzu-cons-mode-line-p t)

(global-anzu-mode +1)

And now this problem is fixed, no matter the require order.

Another remark: I'm using persp-mode for perspectives, and seems not to be handled by spaceline-all-the-icons, but is in space line, so I am confused. And in order for it not to mess up the modeline, it needs to be require'd before the ui stuff (which is where I have the spaceline-all-the-icons) setup. Window numbering however forks just fine ;-)

;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Worspaces requirements
;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(prolusion/require-package 'persp-mode)
(prolusion/require-package 'window-numbering)
(prolusion/require-package 'all-the-icons)

;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Workspaces setup
;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(when (display-graphic-p)
  (window-numbering-mode +1))

(when (display-graphic-p)
  (setq persp-auto-save-fname (expand-file-name "prolusion-perspective" prolusion-save-dir))
  (setq persp-save-dir prolusion-save-dir)
  (setq persp-nil-name (all-the-icons-octicon "dash" :height 0.9 :v-adjust 0.0))
  (custom-set-variables
   '(persp-auto-resume-time -1)
   '(persp-auto-save-opt 0)
   '(persp-keymap-prefix (kbd "C-c w")))
  (persp-mode +1))

And as a last point, M-x space line-toggle-major-mode-on does have any effect whatsoever. Miss it.

Could it also be possible to have buffer current position (line and column segment) on the right ?

Just FYI information, here's my all setup: https://github.com/jwintz/prolusion/tree/develop.

Best,

jwintz commented 7 years ago

Hi,

Sorry for the noise, but I just remembered there use to be a segment for the text-increase count in the default spaceline setup. Is there any way to get it back ?

Many thanks !

jwintz commented 7 years ago

Will dig into segment faces soon. There was another point I wanted to bring up: with spaceline-helm-mode and spaceline-info-mode, using spaceline-all-the-icons, the modelling lowers in height as shown in the screenshot.

Is there a specific scale factor to set up ?

Cheers,

screen shot 2017-04-20 at 16 56 18

jwintz commented 7 years ago

Hi there,

Some answers to my own questions.

Here's my current config:

(use-package spaceline-all-the-icons
  :after spaceline
  :config
  (setq spaceline-all-the-icons-icon-set-flycheck-slim (quote dots))
  (setq spaceline-all-the-icons-icon-set-git-ahead (quote commit))
  ;; (setq spaceline-all-the-icons-icon-set-window-numbering (quote square))
  (setq spaceline-all-the-icons-flycheck-alternate t)
  (setq spaceline-all-the-icons-highlight-file-name t)
  (setq spaceline-all-the-icons-separator-type (quote none))
  (spaceline-all-the-icons-theme)
  (spaceline-all-the-icons--setup-anzu)
  (spaceline-all-the-icons--setup-package-updates)
  (spaceline-all-the-icons--setup-paradox)
  (spaceline-all-the-icons--setup-neotree)
  (spaceline-toggle-all-the-icons-vc-icon-on)
  (spaceline-toggle-all-the-icons-fullscreen-on)
  (spaceline-toggle-all-the-icons-flycheck-status-on)
  (spaceline-toggle-all-the-icons-git-status-on)
  (spaceline-toggle-all-the-icons-vc-icon-on)
  (spaceline-toggle-all-the-icons-mode-icon-on)
  (spaceline-toggle-all-the-icons-package-updates-on)
  (spaceline-toggle-all-the-icons-text-scale-on)
  (spaceline-toggle-all-the-icons-region-info-on))

To be continued, love spaceline-all-the-icons !

domtronn commented 7 years ago

Hey @jwintz, thanks for all the useful information! I genuinely don't mind you asking lots of questions so please keep going.

I hope you don't mind, but I was going to split this into separate issues - just to help me compartmentalise the information and focus on an answer to each one individually. This should hopefully help other users who have similar problems as it should remove noise.

I'll quote the segments of this issue and link them back to this 👍

jwintz commented 7 years ago

Thanks for being so kind. I am slowly getting familiar with to code, so I'll hope to contribute soon.

FieryCod commented 7 years ago

@jwintz Is there any chance that you will show us your .spacemacs file? You configuration is pretty amazing. Could you gist your config please?

jwintz commented 7 years ago

Sure. I'm not using spacemacs. Here my config: https://github.com/jwintz/prolusion/tree/develop.