From 134575e0fe8c7912beb9f0cde27128d366caf297 Mon Sep 17 00:00:00 2001 From: Mutzi Date: Sat, 6 Jul 2024 20:53:44 +0200 Subject: [PATCH] Added padding to make the widgets less jumpy --- src/widgets/3_cpu.lua | 2 +- src/widgets/4_mem.lua | 2 +- src/widgets/6_net.lua | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/widgets/3_cpu.lua b/src/widgets/3_cpu.lua index 5b2b6e0..bca1fa6 100644 --- a/src/widgets/3_cpu.lua +++ b/src/widgets/3_cpu.lua @@ -4,7 +4,7 @@ local wibox = require('wibox') local cpu = lain.widget.cpu({ settings = function() -- luacheck: globals widget cpu_now - widget:set_text(cpu_now.usage .. '%') + widget:set_text(string.format('%3d%%', cpu_now.usage)) end, }) diff --git a/src/widgets/4_mem.lua b/src/widgets/4_mem.lua index a9a151d..327f761 100644 --- a/src/widgets/4_mem.lua +++ b/src/widgets/4_mem.lua @@ -5,7 +5,7 @@ local theme = require('src.theme') local memory = lain.widget.mem({ settings = function() -- luacheck: globals widget mem_now - widget:set_text(mem_now.used .. 'M') + widget:set_text(string.format('%5dM', mem_now.used)) end, }) diff --git a/src/widgets/6_net.lua b/src/widgets/6_net.lua index 9a473f5..77840a5 100644 --- a/src/widgets/6_net.lua +++ b/src/widgets/6_net.lua @@ -6,8 +6,8 @@ local netdowninfo = wibox.widget.textbox() local netupinfo = lain.widget.net({ settings = function() -- luacheck: globals widget net_now - widget:set_text(net_now.sent) - netdowninfo:set_text(net_now.received) + widget:set_text(string.format('%7.2f', net_now.sent)) + netdowninfo:set_text(string.format('%8.2f', net_now.received)) end, })