romkatv / powerlevel10k

A Zsh theme
MIT License
45.22k stars 2.15k forks source link

Battery icon not shown (NF 3.0) #2596

Closed dhnam closed 5 months ago

dhnam commented 5 months ago

So I'm really loving p10k, and had been used it quite a while. (Thank you for making this wonderful theme)

Anyway, I custom-patched a font (which is happened to be nerd font v3.0 as I used docker), and applied the font.

There was a little bit of problem: battery icon is not shown properly.

스크린샷 2024-03-09 012728

I was quite embarrassed, and edited ~/.p10k.zsh. (btw I customized my p10k so I didn't want to use configure)

(...)
  # Defines character set used by powerlevel10k. It's best to let `p10k configure` set it for you.
  typeset -g POWERLEVEL9K_MODE=nerdfont-v3
  # When set to `moderate`, some icons will have an extra space after them. This is meant to avoid
  # icon overlap when using non-monospace fonts. When set to `none`, spaces are not added.
  typeset -g POWERLEVEL9K_ICON_PADDING=moderate
(...)

So I set my typeset to nerdfont-v3, and loaded p10k again - even halted entire system (I used wsl btw, so terminated it) and restarted, but still battery icon is not shown properly.

스크린샷 2024-03-09 013156

This is proof that font itself has battery icon - well, NF 3.0 battery icon, not icon removed.

dhnam commented 5 months ago

Alright, I edited my ~/.p10k.zsh a little bit more. 스크린샷 2024-03-09 020241

Looks like I need to change 'battery' section as well.

I edited this, so it'll be good, I hoped.

스크린샷 2024-03-09 020214

Well, it didn't go well.

dhnam commented 5 months ago

I slept; I woke up; and I see everything is working perfectly fine, somehow....?

image

I don't understand it, but it works now.

dhnam commented 5 months ago

I cannot reproduce this. I'll close it.

jacogasp commented 1 month ago

Hello @dhnam, I used to have your issue with the battery icons. I tried to change the battery stages character as you suggested and it worked, thanks!

# Battery pictograms going from low to high level of charge.
# typeset -g POWERLEVEL9K_BATTERY_STAGES='\uf58d\uf579\uf57a\uf57b\uf57c\uf57d\uf57e\uf57f\uf580\uf581\uf578'
typeset -g POWERLEVEL9K_BATTERY_STAGES='\UF008E\UF007A\UF007B\UF007C\UF007D\UF007E\UF007F\UF0080\UF0081\UF0082\UF0079'

I found also this conversion map that I leave here for reference https://gist.github.com/mischw/78e8e42c2ebb1069560a2fc4573b1425#file-convert_unicode_nerdfont3-py-L116