i3status-rust icon indicating copy to clipboard operation
i3status-rust copied to clipboard

net block color like disk_space

Open deimosfr opened this issue 2 years ago • 5 comments

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 :)

deimosfr avatar May 14 '23 18:05 deimosfr

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

MaxVerevkin avatar May 16 '23 07:05 MaxVerevkin

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?

deimosfr avatar May 16 '23 10:05 deimosfr

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.

MaxVerevkin avatar May 16 '23 10:05 MaxVerevkin

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

deimosfr avatar May 16 '23 17:05 deimosfr

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.

MaxVerevkin avatar May 16 '23 20:05 MaxVerevkin