home · contact · privacy
Add volume commands.
authorChristian Heller <c.heller@plomlompom.de>
Thu, 20 Mar 2025 07:00:02 +0000 (08:00 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Thu, 20 Mar 2025 07:00:02 +0000 (08:00 +0100)
testing/home/desktop/.local/bin/vol [new file with mode: 0755]
testing/home/t490s/.nonpath_bins/status.sh

diff --git a/testing/home/desktop/.local/bin/vol b/testing/home/desktop/.local/bin/vol
new file mode 100755 (executable)
index 0000000..80f427d
--- /dev/null
@@ -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
index ce1a4330f1b73245a0ffd6596463ac45e5ad314b..6bcf1145118d47267bfb541659914dd62a4a2e9c 100755 (executable)
@@ -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() {