Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Help needed [network module] #1505

Closed
EliaHKM opened this issue Apr 2, 2022 · 10 comments
Closed

Help needed [network module] #1505

EliaHKM opened this issue Apr 2, 2022 · 10 comments

Comments

@EliaHKM
Copy link

EliaHKM commented Apr 2, 2022

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

@evanmohr
Copy link

Same issue. And if I put in {bandwidthUpBytes}, it the module disappears entirely.

@UltraBlackLinux
Copy link

UltraBlackLinux commented Apr 24, 2022

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.

@hboetes
Copy link

hboetes commented May 21, 2022

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")));

@yoogottamk
Copy link

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}"
}

@kooskaspers
Copy link

So the interval gets ignored regarding the {bandwidthUpBits} or {bandwidthUpBytes} variable?

@yoogottamk
Copy link

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.

@kooskaspers
Copy link

Got it. I assigned "1" as an interval, it shoud've been just 1, without quotes (int).

@kooskaspers
Copy link

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?

@kohane27
Copy link

kohane27 commented Jul 20, 2022

@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
Copy link

@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.

@Alexays Alexays closed this as completed Oct 27, 2022
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

No branches or pull requests

8 participants