Waybar
Waybar copied to clipboard
Help needed [network module]
Hi 🙋🏻, Could you correct me
`"network": { // "interface": "wlp2*", // (Optional) To force the use of this interface "format-wifi": "{essid} ({signalStrength}%) 🌊", "format-ethernet": "{ifname}: {ipaddr}/{cidr} 🔗 | {bandwidthUpBits} ⬆️ {bandwidthDownBits} ⬇️ ", "format-linked": "{ifname} (No IP) ⛔", "format-disconnected": "Disconnected ✈️", "format-alt": "{ifname}: {ipaddr}/{cidr}"
},` how can I make the bandwidth working it gives 0b/s thanks in advance
Same issue. And if I put in {bandwidthUpBytes}, it the module disappears entirely.
Whenever I use format-ethernet together with bandwitdh*Bytes I just get an error, that the argument can't be found
Ah yes. Bytes just doesn't exist, so the wiki is wrong. Unrelated problem apparently.
bandwidthupbytes does exist. It has a bug.
% grep bandwidthUpB
man/waybar-network.5.scd
*{bandwidthUpBits}*: Instant up speed in bits/seconds.
src/modules/network.cpp
fmt::arg("bandwidthUpBits", pow_format(bandwidth_up * 8ull / interval_.count(), "b/s")),
fmt::arg("bandwidthUpBytes", pow_format(bandwidth_up / interval_.count(), "B/s")));
fmt::arg("bandwidthUpBits", pow_format(bandwidth_up * 8ull / interval_.count(), "b/s")),
fmt::arg("bandwidthUpBytes", pow_format(bandwidth_up / interval_.count(), "B/s")));
The speed stays 0 initially but starts updating speed after a minute. The interval setting is 60 by default.
"network": {
"interval": 5, // in seconds
"format-wifi": "{essid} ({signalStrength}%) ocean",
"format-ethernet": "{ifname}: {ipaddr}/{cidr} link | {bandwidthUpBits} arrow_up {bandwidthDownBits} arrow_down ",
"format-linked": "{ifname} (No IP) no_entry",
"format-disconnected": "Disconnected airplane",
"format-alt": "{ifname}: {ipaddr}/{cidr}"
}
So the interval gets ignored regarding the {bandwidthUpBits} or {bandwidthUpBytes} variable?
No
The default interval is 1 minute. Those values get updated every interval seconds.
By default, it would mean that {bandwidthUpBits} or {bandwidthUpBytes} get updated every minute. Initially the values must be 0, that's why the speed stays 0 for a long time before changing to something else.
The module works (for me at least). Just reduce the interval.
Got it. I assigned "1" as an interval, it shoud've been just 1, without quotes (int).
By the way, I'm trying to set the module width to a fixed position by specifying:
"format-wifi": " {bandwidthUpBytes:6} {bandwidthDownBytes:6}"
This is working fine for like the cpu module, but the network module isn't respecting these max 6 length positions. It's still adjusting it's width. Any idea how to cope with this?
@kooskaspers The request for a fixed width for network module is mentioned in Limit length of modules · Issue #486 · Alexays/Waybar and the pr: Add a custom formatter for "pow" numbers. by layus · Pull Request #472 · Alexays/Waybar
In short: "format-wifi": " {bandwidthDownBytes:>} {bandwidthUpBytes:>}", and I get a constant fixed by reserving space for it.
@kooskaspers The request for a fixed width for network module is mentioned in Limit length of modules · Issue #486 · Alexays/Waybar and the pr: Add a custom formatter for "pow" numbers. by layus · Pull Request #472 · Alexays/Waybar
In short:
"format-wifi": " {bandwidthDownBytes:>} {bandwidthUpBytes:>}",and I get a constant fixed by reserving space for it.
Tested, and working great! Thanks.