Skip to content

net widget units issue #514

Description

@t0m5k1

Hi,

I've tried to read the wiki but I can't fathom why when U try to include a setting for units on the net widget it has no effect and doesn't produce an error.

❯ awesome -v
awesome v4.3 (Too long)
 • Compiled against Lua 5.3.5 (running with Lua 5.3)
 • D-Bus support: ✔
 • execinfo support: ✔
 • xcb-randr version: 1.6
 • LGI version: 0.9.2
❯ lua -v
Lua 5.4.3  Copyright (C) 1994-2021 Lua.org, PUC-Rio

My expected behaviour is that when I add units = 1024^2 the metrics displayed in the widget will change from a 4-5 digit number (8546.3) to a 1 or 2 digit number (5.6)

This is the widget I'm using:

-- Net
local neticon = wibox.widget.imagebox(theme.widget_net)
local net = lain.widget.net({
	
	settings = function()
	units = 1024^2
		widget:set_markup(markup.font(theme.font,
				markup("#7AC82E", " " .. net_now.received)
					.. " " ..
				markup("#46A8C3", " " .. net_now.sent .. " ")))
	end
})

The units setting is being ignored as I still see a 4 digit number for received and sent, now considering my connection is 69 mb/ps I'd expect to see maybe 6.9 or lower if it was displaying megabytes.

I hope someone can help as I'm finding this quite confusing as I'm not a programmer and have no full grasp of lua.

Cheers

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions