aboutsummaryrefslogtreecommitdiff
path: root/scripts/.local/bin/personal/volctl
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/.local/bin/personal/volctl')
-rwxr-xr-xscripts/.local/bin/personal/volctl22
1 files changed, 22 insertions, 0 deletions
diff --git a/scripts/.local/bin/personal/volctl b/scripts/.local/bin/personal/volctl
new file mode 100755
index 0000000..6dc6e6b
--- /dev/null
+++ b/scripts/.local/bin/personal/volctl
@@ -0,0 +1,22 @@
+#!/bin/bash
+
+# A script to manage the volume on my system universally
+
+sink="$(pactl list short sinks | grep "pci-0000_00_1b.0" | awk '{print $1}')"
+volume="$(pamixer --get-volume)"
+
+if [ "$1" = "increase" ]
+then
+ pactl set-sink-volume "$sink" +5%
+elif [ "$1" = "decrease" ]
+then
+ pactl set-sink-volume "$sink" -5%
+elif [ "$1" = "mute" ]
+then
+ pactl set-sink-volume "$sink" 0%
+elif [ "$1" = "check" ]
+then
+ printf "%s\n" "$volume"
+else
+ printf "[ Error ] Not enough arguments.\n"
+fi