greshake / i3status-rust

Very resourcefriendly and feature-rich replacement for i3status, written in pure Rust
GNU General Public License v3.0
2.86k stars 472 forks source link

constant width of blocks #1937

Closed uniqueNullptr2 closed 1 year ago

uniqueNullptr2 commented 1 year ago

I would like my bar to stay ata constant width cause it draws too much focus when it jumps because the width increases/decreases

so far I have found 2 problems causing this in my setup

  1. Icon width. The volume icon changing depending on the volume doesnt have a constant width. at least with awesomefonts. I have not gotten around to trying the material fonts yet
  2. the formatting of $speed_down and the up variant doesnt allow for setting a cosntant width. I can set a constant width for the number only. but when it changes from B to KB that isnt included in the set formatting causing it to jump. In general the number formatting only allowing for setting of minimum width and not including the Unit width should be expanded upon.

Would need some help with 1 if possible as for 2 I would be happy to take a crack at expanding the number formatting a bit to fix the issue

bim9262 commented 1 year ago

Icon width is tricky... We don't know how wide the strings are in whichever font you are using (they can be more than a single character wide). However even if the icons are only a single character wide, not all characters are the same length.

Say I had made the volume icon progression the following:

[
"ο·½",
"𒐫",
"π’ˆ™",
"βΈ»",
"κ§…"
"πŸ˜›"
]

Each of those are only a single character, but as you can see (if you have the right fonts), they're not the same width.

Has the number formatting been fixed by #1934 (this is in master,but hasn't been released yet)?

bim9262 commented 1 year ago

Let us know if this needs to be reopened