From 9825fdc46654fad056825a153746fc782119662c Mon Sep 17 00:00:00 2001
From: Christian Heller <c.heller@plomlompom.de>
Date: Thu, 20 Mar 2025 08:00:02 +0100
Subject: [PATCH] Add volume commands.

---
 testing/home/desktop/.local/bin/vol        | 8 ++++++++
 testing/home/t490s/.nonpath_bins/status.sh | 2 +-
 2 files changed, 9 insertions(+), 1 deletion(-)
 create mode 100755 testing/home/desktop/.local/bin/vol

diff --git a/testing/home/desktop/.local/bin/vol b/testing/home/desktop/.local/bin/vol
new file mode 100755
index 0000000..80f427d
--- /dev/null
+++ b/testing/home/desktop/.local/bin/vol
@@ -0,0 +1,8 @@
+#!/bin/sh
+if [ "$1" = "m" ]; then
+    pacmd set-sink-mute 0 1
+elif [ "$1" = "u" ]; then
+    pacmd set-sink-mute 0 0
+else
+    pacmd set-sink-volume 0 $(calc "($1 * 65536 // 100)")
+fi
diff --git a/testing/home/t490s/.nonpath_bins/status.sh b/testing/home/t490s/.nonpath_bins/status.sh
index ce1a433..6bcf114 100755
--- a/testing/home/t490s/.nonpath_bins/status.sh
+++ b/testing/home/t490s/.nonpath_bins/status.sh
@@ -136,7 +136,7 @@ print_volume() {
         MUTE=
 	COLOR="${COL_RED}"
     fi
-    print_bar_block "v:${MUTE}$(pactl get-sink-volume 0 | head -1 | cut -d' ' -f5)" "${COLOR}"
+    print_bar_block "v:${MUTE}$(pactl get-sink-volume 0 | head -1 | sed 's/ //g' | cut -d'/' -f2)" "${COLOR}"
 }
 
 print_keyboard() {
-- 
2.30.2