]> Freerunner's - dotfiles.git/commitdiff
local/bin: add some scripts to control volume
authorAndre Ramnitz <tux.rising@gmail.com>
Wed, 25 Jun 2025 21:08:21 +0000 (23:08 +0200)
committerAndre Ramnitz <tux.rising@gmail.com>
Wed, 25 Jun 2025 21:08:21 +0000 (23:08 +0200)
dot-local/bin/wp+ [new file with mode: 0755]
dot-local/bin/wp- [new file with mode: 0755]
dot-local/bin/wp-vol [new file with mode: 0755]

diff --git a/dot-local/bin/wp+ b/dot-local/bin/wp+
new file mode 100755 (executable)
index 0000000..c758afc
--- /dev/null
@@ -0,0 +1,11 @@
+#!/bin/dash
+
+wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+
+
+# Get the volume level and convert it to a percentage
+volume=$(wpctl get-volume @DEFAULT_AUDIO_SINK@)
+volume=$(echo "$volume" | awk '{print $2}')
+volume=$(echo "( $volume * 100 ) / 1" | bc)
+
+notify-send -t 1000 -a 'wp-vol' -h int:value:"$volume" "Volume: ${volume}%"
+
diff --git a/dot-local/bin/wp- b/dot-local/bin/wp-
new file mode 100755 (executable)
index 0000000..d9bd42b
--- /dev/null
@@ -0,0 +1,11 @@
+#!/bin/dash
+
+wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-
+
+# Get the volume level and convert it to a percentage
+volume=$(wpctl get-volume @DEFAULT_AUDIO_SINK@)
+volume=$(echo "$volume" | awk '{print $2}')
+volume=$(echo "( $volume * 100 ) / 1" | bc)
+
+notify-send -t 1000 -a 'wp-vol' -h int:value:"$volume" "Volume: ${volume}%"
+
diff --git a/dot-local/bin/wp-vol b/dot-local/bin/wp-vol
new file mode 100755 (executable)
index 0000000..2b89c1a
--- /dev/null
@@ -0,0 +1,9 @@
+#!/bin/dash
+
+# Get the volume level and convert it to a percentage
+volume=$(wpctl get-volume @DEFAULT_AUDIO_SINK@)
+volume=$(echo "$volume" | awk '{print $2}')
+volume=$(echo "( $volume * 100 ) / 1" | bc)
+
+notify-send -t 1000 -a 'wp-vol' -h int:value:"$volume" "Volume: ${volume}%"
+