From 8308de4e6cb44a84bd326cccd74a1017648aaabd Mon Sep 17 00:00:00 2001 From: Vidhu Kant Sharma Date: Sun, 25 May 2025 19:14:21 +0530 Subject: modified dwm luastatus scripts --- .config/luastatus-scripts-dwm/pulse-gauge.lua | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .config/luastatus-scripts-dwm/pulse-gauge.lua (limited to '.config/luastatus-scripts-dwm/pulse-gauge.lua') diff --git a/.config/luastatus-scripts-dwm/pulse-gauge.lua b/.config/luastatus-scripts-dwm/pulse-gauge.lua new file mode 100644 index 0000000..dbc5c67 --- /dev/null +++ b/.config/luastatus-scripts-dwm/pulse-gauge.lua @@ -0,0 +1,18 @@ +local GAUGE_NCHARS = 10 + +local function mk_gauge(level, full, empty) + local nfull = math.floor(level * GAUGE_NCHARS + 0.5) + return full:rep(nfull) .. empty:rep(GAUGE_NCHARS - nfull) +end + +widget = { + plugin = 'pulse', + cb = function(t) + local level = t.cur / t.norm + if t.mute then + return mk_gauge(level, '×', '—') + else + return mk_gauge(level, '●', '○') + end + end, +} -- cgit v1.2.3