Skip to content

net block: allow defining absolute up and down bandwidth#2273

Open
GRBurst wants to merge 5 commits into
greshake:masterfrom
GRBurst:feat-net-bandwidth
Open

net block: allow defining absolute up and down bandwidth#2273
GRBurst wants to merge 5 commits into
greshake:masterfrom
GRBurst:feat-net-bandwidth

Conversation

@GRBurst
Copy link
Copy Markdown

@GRBurst GRBurst commented Apr 28, 2026

Hey there 👋,

thanks for the awesome bar, I am using it for quite some time and I happy with it :-)

Regarding, the network graph, for me, the current implementation is not very intuitive. The main reason is that it is relative and the base is constantly changing. I am usually interested in the network load in relation to my network capability, such that a bit "more" noise does not show up as spikes.

This PR adds the capability to define your network up and down speed. I am using this implementation on my site for quite some time already. It works stable and reliable on my site.

I am open for discussion, because although this is much more intuitive to me, it does not have to be the case for everyone. I still believe that for most users, it will be more intuitive. Let's discuss improvements / alternatives if you don't agree.

Here is an example:

[[block]]
block = "net"
network_speed_down = 100.0  # 100 Mbit/s down
network_speed_up = 20.0     # 20 Mbit/s up

The result would be:

  • With 50 Mbit/s traffic: graph_down shows 50% of full bar (not 100% due to spike)

Signed-off-by: GRBurst <GRBurst@protonmail.com>
Signed-off-by: GRBurst <GRBurst@protonmail.com>
Signed-off-by: GRBurst <GRBurst@protonmail.com>
Signed-off-by: GRBurst <GRBurst@protonmail.com>
Signed-off-by: GRBurst <GRBurst@protonmail.com>
@ammgws
Copy link
Copy Markdown
Collaborator

ammgws commented May 1, 2026

This sounds like it could be a nice option to have. Some users might be more interested in local network speeds so perhaps in that case it can default to the link speed?

Comment thread src/blocks/net.rs
"device" => Value::text(device.iface.name),
});

if speed_down / max_network_speeds.down > 0.8 || speed_up / max_network_speeds.up > 0.8 {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps break this 0.8 out into a named variable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants