aboutsummaryrefslogtreecommitdiff
path: root/scripts/.local/bin/personal/volctl
diff options
context:
space:
mode:
authordavidpkj <davidpenkow1@gmail.com>2022-12-03 22:26:26 +0100
committerdavidpkj <davidpenkow1@gmail.com>2022-12-03 22:26:26 +0100
commit5d4a749b7c51649bcd3953cd1686856408d08121 (patch)
treed0ddab7d5ee206e9b4403d4f177d942ec1608aa0 /scripts/.local/bin/personal/volctl
parent4f7ccffecdfa36c5e531654b8eec44199935d497 (diff)
Merge in dotfiles
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