From 954892886a0e12a3dc9d55692ad0eb4e9f504ce8 Mon Sep 17 00:00:00 2001
From: Christian Heller <c.heller@plomlompom.de>
Date: Tue, 18 Mar 2025 01:08:09 +0100
Subject: [PATCH] Improve status script;

---
 testing/home/t490s/.nonpath_bins/status.sh | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/testing/home/t490s/.nonpath_bins/status.sh b/testing/home/t490s/.nonpath_bins/status.sh
index a1b965e..ee2e226 100755
--- a/testing/home/t490s/.nonpath_bins/status.sh
+++ b/testing/home/t490s/.nonpath_bins/status.sh
@@ -54,7 +54,7 @@ print_battery() {
     elif [ "${CHARGE}" -lt 65 ]; then
         COLOR="${COL_YELLOW}"
     fi
-    print_bar_block "${CHARGE}" "${COLOR}" 0
+    print_bar_block "${CHARGE}%" "${COLOR}" 0
 
     COLOR="${COL_WHITE}"
     STATUS=$(cat "${BAT_DIR}/status")
@@ -70,7 +70,7 @@ print_battery() {
     fi
     print_bar_block "${CHARGING}" "${COLOR}" 0
 
-    print_bar_block "$(calc_percent full full_design)"
+    print_bar_block "$(calc_percent full full_design)%"
 }
 
 print_temperature() {
@@ -95,6 +95,15 @@ print_datetime() {
     print_bar_block "${TZ}" ""
 }
 
+print_volume() {
+    MUTE=M
+    if [ "$(pactl get-sink-mute 0)" = "Mute: no" ]; then
+        MUTE=
+	COLOR="${COL_WHITE}"
+    fi
+    print_bar_block "v:${MUTE}$(pactl get-sink-volume 0 | head -1 | cut -d' ' -f5)" "${COLOR}"
+}
+
 print_keyboard() {
     LAYOUT=$(swaymsg -t get_inputs | grep 'xkb_active_layout_name' | sed -E 's/[ ,"]+//g' | cut -d':' -f2 | head -1)
     if [ "${LAYOUT}" = "English(US)" ]; then
@@ -114,6 +123,7 @@ while true; do
     print_battery
     print_temperature
     print_datetime
+    print_volume
     print_keyboard
     printf '],'
     sleep 0.1
-- 
2.30.2