summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--net-speed-widget/net-speed.lua18
1 files changed, 12 insertions, 6 deletions
diff --git a/net-speed-widget/net-speed.lua b/net-speed-widget/net-speed.lua
index 6dd3b05..248e913 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/s'
+ dim = 'b'
elseif bits < 1000000 then
speed = bits/1000
- dim = 'kb/s'
+ dim = 'k'
elseif bits < 1000000000 then
speed = bits/1000000
- dim = 'mb/s'
+ dim = 'm'
elseif bits < 1000000000000 then
speed = bits/1000000000
- dim = 'gb/s'
+ dim = 'g'
else
speed = tonumber(bits)
- dim = 'b/s'
+ dim = 'b'
end
return math.floor(speed + 0.5) .. dim
end
@@ -55,17 +55,21 @@ local function worker(user_args)
local args = user_args or {}
+ local font = args.font or 'mononoki Nerd Font Mono 1'
+
local interface = args.interface or '*'
local timeout = args.timeout or 1
- local width = args.width or 55
+ local width = args.width or 40
net_speed_widget = wibox.widget {
{
id = 'rx_speed',
forced_width = width,
align = 'right',
+ font = font,
widget = wibox.widget.textbox
},
+ ---[[
{
image = ICONS_DIR .. 'down.svg',
widget = wibox.widget.imagebox
@@ -74,10 +78,12 @@ local function worker(user_args)
image = ICONS_DIR .. 'up.svg',
widget = wibox.widget.imagebox
},
+ --]]
{
id = 'tx_speed',
forced_width = width,
align = 'left',
+ font = font,
widget = wibox.widget.textbox
},
layout = wibox.layout.fixed.horizontal,