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

nvidia_gpu block: add format string because spaces between the widgets are too large #800

Closed DCsunset closed 4 years ago

DCsunset commented 4 years ago

Now many blocks support format string. It would be great if the nvidia_gpu block also supports it.

If there's no plan to implement it currently, I could submit a PR in a few days :)

ammgws commented 4 years ago

See here: https://github.com/greshake/i3status-rust/pull/754

Feel free to submit a PR :)

DCsunset commented 4 years ago

After looking into the code, I found it hard to add the format string because the block consists of widgets, some of which could be clicked, and I haven't come up with any idea how to add it.

I originally came up with this issue because the spaces between the widgets are too large (each widget has both a leading space and a trailing space). Maybe I could try to add a property inline to the widget to remove the leading space when used in the same block. Does it make sense?

ammgws commented 4 years ago

I originally came up with this issue because the spaces between the widgets are too large (each widget has both a leading space and a trailing space).

I believe this is an issue with the music block as well (IIRC related discussion here https://github.com/greshake/i3status-rust/issues/468).

add a property inline to the widget to remove the leading space when used in the same block.

Hmm, perhaps this is the only way forward?

DCsunset commented 4 years ago

I think so because the widget inside a block should behave differently from the whole block. Maybe I could submit a PR for it?

ammgws commented 4 years ago

Yeah it would be easier to proceed if there's some code to look at/test.

DCsunset commented 4 years ago

I have submitted a PR to resolve this issue. I hope it could be helpful.