greshake / i3status-rust

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

net block color like disk_space #1900

Open deimosfr opened 1 year ago

deimosfr commented 1 year ago

Hi,

First, thanks for this project :)

I want to add a suggestion to the net bloc. From my point of view, it would be useful to have color if we reach some bandwidth speed. I felt it helpful in the past (using another i3status project) to have the info and be warned about it with color (ex: be in a conference call, have some connectivity issues because you have a backup in progress or something else).

So if this feature could come, that could be great!

Thanks in advance :)

MaxVerevkin commented 1 year ago

Do you have a proposal what the configuration might look like?

deimosfr commented 1 year ago

Hi,

Sure. For example, I did one for disk throughput and iostat. It should look the same for net block (here if you want to have a look): image image image

Here was the plugin I was using before i3status-rust on i3blocks, you should find useful inputs in it as well: https://github.com/vivien/i3blocks-contrib/tree/master/bandwidth2

Regarding the configuration, it would be great to separate rx and tx. Here are some ideas:

# threshold for RX in kb/s
rx_alert_kbs = 10000
rx_warning_kbs = 8000
# threshold for TX in kb/s
tx_alert_kbs = 10000
tx_warning_kbs = 8000

What do you think?

MaxVerevkin commented 1 year ago

Highlighting rx and tx separately can be a bit problematic... Right now individual values can be normal, italic and/or underlined, but highlighting is applied to entire blocks.

deimosfr commented 1 year ago

Can you please elaborate a little bit more on the problem you see? As I3 supports HTML code for this kind of usage, I'd like to understand what's the issue. And let me know if I can help. Thanks

MaxVerevkin commented 1 year ago

The current theming model assigns each "state" a foreground and background. It is not clear how to apply a background to a single value. I mean we can, but it looks ugly without spaces (see #1560 and #1622). This is non-issue for themes with transparent / consistent background, though.