summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzachir <zachir@librem.one>2023-11-05 17:16:48 -0600
committerzachir <zachir@librem.one>2023-11-05 17:16:48 -0600
commit167a2f71f6f4ef5d2fd79d8992a40bfba3bcb217 (patch)
tree658c7743abdd6af7d1f356d9ed7509867dee1b2a
parenta1cd133f38ab5f6b3c80e4e74a0a45e1c6326b11 (diff)
Change how net-speed widget looks
-rw-r--r--net-speed-widget/net-speed.lua22
1 files changed, 5 insertions, 17 deletions
diff --git a/net-speed-widget/net-speed.lua b/net-speed-widget/net-speed.lua
index 31c701f..5663bd0 100644
--- a/net-speed-widget/net-speed.lua
+++ b/net-speed-widget/net-speed.lua
@@ -23,19 +23,19 @@ local function convert_to_h(bytes)
local bits = bytes * 8
if bits < 1000 then
speed = bits
- dim = 'b'
+ dim = 'B/s'
elseif bits < 1000000 then
speed = bits/1000
- dim = 'k'
+ dim = 'KB/s'
elseif bits < 1000000000 then
speed = bits/1000000
- dim = 'm'
+ dim = 'MB/s'
elseif bits < 1000000000000 then
speed = bits/1000000000
- dim = 'g'
+ dim = 'GB/s'
else
speed = tonumber(bits)
- dim = 'b'
+ dim = 'b/s'
end
return math.floor(speed + 0.5) .. dim
end
@@ -68,22 +68,10 @@ local function worker(user_args)
font = font,
widget = wibox.widget.textbox
},
- --[[
- {
- image = ICONS_DIR .. 'down.svg',
- widget = wibox.widget.imagebox
- },
- {
- image = ICONS_DIR .. 'up.svg',
- widget = wibox.widget.imagebox
- },
- --]]
- ---[[
{
text = "⬆️⬇️",
widget = wibox.widget.textbox
},
- --]]
{
id = 'tx_speed',
forced_width = width,