From 05da0e10926d4ade3b10a55999a0ed1b797caf65 Mon Sep 17 00:00:00 2001 From: Vidhu Kant Sharma Date: Wed, 14 May 2025 22:50:39 +0530 Subject: added luastatus config --- .config/luastatus-scripts-dwm/battery.lua | 53 +++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 .config/luastatus-scripts-dwm/battery.lua (limited to '.config/luastatus-scripts-dwm/battery.lua') diff --git a/.config/luastatus-scripts-dwm/battery.lua b/.config/luastatus-scripts-dwm/battery.lua new file mode 100644 index 0000000..6155fd4 --- /dev/null +++ b/.config/luastatus-scripts-dwm/battery.lua @@ -0,0 +1,53 @@ +widget = luastatus.require_plugin('battery-linux').widget{ + period = 2, + cb = function(t) + icon = "" + if t.status == "Discharging" then + if t.capacity < 10 then + icon = "󰁺" + elseif t.capacity < 20 then + icon = "󰁻" + elseif t.capacity < 30 then + icon = "󰁼" + elseif t.capacity < 40 then + icon = "󰁽" + elseif t.capacity < 50 then + icon = "󰁾" + elseif t.capacity < 60 then + icon = "󰁿" + elseif t.capacity < 70 then + icon = "󰂀" + elseif t.capacity < 80 then + icon = "󰂁" + elseif t.capacity < 90 then + icon = "󰂂" + else + icon = "󰁹" + end + else + if t.capacity < 10 then + icon = "󰢜" + elseif t.capacity < 20 then + icon = "󰂆" + elseif t.capacity < 30 then + icon = "󰂇" + elseif t.capacity < 40 then + icon = "󰂈" + elseif t.capacity < 50 then + icon = "󰢝" + elseif t.capacity < 60 then + icon = "󰂉" + elseif t.capacity < 70 then + icon = "󰢞" + elseif t.capacity < 80 then + icon = "󰂊" + elseif t.capacity < 90 then + icon = "󰂋" + else + icon = "󰂅" + end + end + + return string.format('%s %3d%%', icon, t.capacity) + end, +} -- cgit v1.2.3