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

Support non-pango fonts #1854

Open YarekTyshchenko opened 1 year ago

YarekTyshchenko commented 1 year ago

Seems to be related to this?:

https://github.com/greshake/i3status-rust/blob/325f6de4a20799625b7ae6c95a2c7e2241d06c3d/src/widget.rs#L94

2023-04-06-133155_117x38_scrot

[[block]]
block = "custom_dbus"
path = "/foo"
format = "$text.pango-str()"

Sending dbus command:

busctl --user call rs.i3status /foo rs.i3status.custom SetState s warning
busctl --user call rs.i3status /foo rs.i3status.custom SetText ss "1004" ""

Sending non-empty short-text doesn't seem to change anything

I'm using the semi-native theme, installed by copying the file and refering to it with full path. For some reason cargo didn't put themes into the expected location for me.

i3status-rs 0.30.6 (commit  )
i3 version 4.20.1 (2021-11-03) © 2009 Michael Stapelberg and contributors
MaxVerevkin commented 1 year ago

Which bar are you using?

MaxVerevkin commented 1 year ago

I just tested i3bar from i3 4.22-3 and it works fine.

MaxVerevkin commented 1 year ago

For some reason cargo didn't put themes into the expected location for me.

That's a limitation of cargo. See install.sh.

MaxVerevkin commented 1 year ago

Don't forget to enable pango in your config if you explicitly set font: https://github.com/greshake/i3status-rust#integrate-it-into-i3sway

YarekTyshchenko commented 1 year ago
i3bar version 4.20.1 (2021-11-03) © 2010 Axel Wagner and contributors

My i3 settings are:

bar {
    status_command i3status-rs ~/.config/i3status-rs/config.toml
}

The issue seems to go away if I specify a pango font (font pango:monospace 12), but those fonts make the text blury, which is why I don't use them. Seems like a proper can of worms last time I looked into that issue. Any way around this?

Crisp: 2023-04-06-143534_158x29_scrot

Blurry: 2023-04-06-143513_116x30_scrot

bim9262 commented 1 year ago

I can't get the <span/> to show up, but if you still see this problem you could test replacing the <span/> with \u{200b} (a zero width space)