awesome-wm-widgets icon indicating copy to clipboard operation
awesome-wm-widgets copied to clipboard

Request for net-widget

Open petterssonjonas opened this issue 4 years ago • 3 comments

Im using the lain net_widget, and it kinda sucks. I'd like to request a functional network device rx/tx output widget that calculates something like /sys/clas/net/*/statistics/?x_bytes output from bytes to b, kB, MB, GB.

Thank's for all your great work :)

petterssonjonas avatar Jul 09 '20 17:07 petterssonjonas

I created a simple text widget which displays up/down speed: https://github.com/streetturtle/awesome-wm-widgets/tree/master/net-speed-widget. I'll work on it more, but it can already be used:

local net_speed_widget = require("awesome-wm-widgets.net-speed-widget.net-speed")
...
net_speed_widget({
    interface = 'wlp0s20f3'
})

streetturtle avatar Jul 21 '20 02:07 streetturtle

Awesome, thanks mate! Just one minor problem. The widget wont recognize my args.interface from the rc or if i set it in the widget file it self. It spits out two "interface name is not specified" errors. I did this and it pops up; tough no numbers show up:

>     local args = "enp3s0" --args or {}
> 
> --    if args.interface == nil then
> --        show_warning("Interface name is not specified")
> --        return
> --   end

Edit: i removed .interface from args on line 103 and it works.

Now that numbers show up, i noticed that when any number above 0 is shown it flashes and returns to 0 after ~.5s before updating.

I also looked at it as i downloaded a file, and the numbers dont show anything near what the torrent program shows as rx/tx. To be fair neither does the lain widget.

Just some feedback, hope it helps when you work at it more :)

petterssonjonas avatar Jul 21 '20 04:07 petterssonjonas

@fuzebox1 please check if the issues you mentioned are still reproducible as of master / 2e2ae41. Otherwise I believe this can be closed :)

nuno-silva avatar Jun 13 '21 01:06 nuno-silva