Alexays / Waybar

Highly customizable Wayland bar for Sway and Wlroots based compositors. :v: :tada:
MIT License
6.75k stars 708 forks source link

Network bandwidth is not calculated correctly if forced to reload #3718

Open qbe opened 4 weeks ago

qbe commented 4 weeks ago

Using the (somewhat) new bandwidth format options in the network module, I can force the bandwidth to update by clicking on the module twice (switching in and out of alt-mode), but the displayed bandwidth is too small (checked by running a speedtest).

Probable cause: the bandwidth calculation seems to assume that a full interval_ elapsed, but this isn't the case when forcing a reload by clicking.

Possible solution: do not use interval_ for time-delta calculations, change to querying time when calculating the bandwidth delta, and save the queried time in a similar manner to the bandwidth totals.