greshake / i3status-rust

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

Add only one space around values in the block #1334

Closed c02y closed 1 year ago

c02y commented 3 years ago

image Check out this screenshort of my i3status-rust bar, there are

  1. two spaces before the cpu value
  2. two spaces before the mem value
  3. no space before the disk space value

The perfect way is no matter how big or small the values are, there will be only one space before and after the value in the blocks.

I managed to manually set it this way:

[[block]]
block = "cpu"
format = "{utilization:1}"

[[block]]
block = "memory"
format_mem = "{mem_used:1}"
format_swap = "{swap_used:1}"

[[block]]
block = "disk_space"
format = "{icon:2}{available:1}"

[[block]]
block = "sound"
format = "{volume:1}"

I'm not sure this is the right way, and format = "{icon:2}{available:1}" line seems weird to me.

I believe this style (only one space around values) should be set by default.

GladOSkar commented 3 years ago

Consistent spacing has been a difficult issue for a long time despite various fixes/solutions. The new formatter (#1304) will probably have a more consistent solution though, but we'll see about that. Unfortunately the rendering of different icon fonts with different renderers also seems to result in different spacings at times.

cfsmp3 commented 2 years ago

image Check out this screecut of my i3status-rust bar, there are

What font are you using? It looks great

c02y commented 2 years ago

image Check out this screecut of my i3status-rust bar, there are

What font are you using? It looks great

The text font is DejaVu Sans Mono, icon font is Font Awesome 5

Set this in the bar {} section of i3/config file

font pango:DejaVu Sans Mono, Font Awesome 5 13.5
cfsmp3 commented 2 years ago

font pango:DejaVu Sans Mono, Font Awesome 5 13.5

What's the output of these commands?

❯ fc-match Fontawesome
FontAwesome.otf: "FontAwesome" "Regular"

❯ fc-match "Fontawesome 5"
DejaVuSans.ttf: "DejaVu Sans" "Book"

❯ fc-list |grep -i awesome
/usr/share/fonts/opentype/font-awesome/FontAwesome.otf: FontAwesome:style=Regular
/usr/share/fonts/truetype/font-awesome/fontawesome-webfont.ttf: FontAwesome:style=Regular

❯ fc-match "DejaVu Sans Mono"
DejaVuSansMono.ttf: "DejaVu Sans Mono" "Book"

Icons is the thing I'm struggling to get right. For example for CPU I get a phone...

c02y commented 2 years ago

font pango:DejaVu Sans Mono, Font Awesome 5 13.5

What's the output of these commands?

❯ fc-match Fontawesome
FontAwesome.otf: "FontAwesome" "Regular"

❯ fc-match "Fontawesome 5"
DejaVuSans.ttf: "DejaVu Sans" "Book"

❯ fc-list |grep -i awesome
/usr/share/fonts/opentype/font-awesome/FontAwesome.otf: FontAwesome:style=Regular
/usr/share/fonts/truetype/font-awesome/fontawesome-webfont.ttf: FontAwesome:style=Regular

❯ fc-match "DejaVu Sans Mono"
DejaVuSansMono.ttf: "DejaVu Sans Mono" "Book"

Icons is the thing I'm struggling to get right. For example for CPU I get a phone...

I think you are using FontAwesome4, my config is for FontAwesome5

Follow the README file in this repo

Optional:

- Font Awesome 4.x is required when using the icons config name = "awesome". For version 5, use name = "awesome5". On Arch Linux version 4 is available in the AUR, and version 5 is available here.
cfsmp3 commented 2 years ago

I think you are using FontAwesome4, my config is for FontAwesome5

Nah, my config for was 5 too. I think the Ubuntu included font awesome is not correct

❯ dpkg -l |grep awesome
ii  fonts-font-awesome                          5.0.10+really4.7.0~dfsg-4.1              all          iconic font designed for use with Twitter Bootstrap

I just installed the .otf files manually into the fonts dir, seems correct now (assuming the load one is supposed to be one large cog and two smaller ones).

c02y commented 2 years ago

My FontAwesome5 files are ttf files installed from ArchLinux repo.

MaxVerevkin commented 1 year ago

I believe this is fixed now.