aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorNicholas Noll <nnoll523@gmail.com>2020-06-26 19:40:25 +0200
committerNicholas Noll <nnoll523@gmail.com>2020-06-26 19:40:25 +0200
commit476516d4b144e6bcd9211e0d23c829f34c0b7833 (patch)
treec7e5a36d4d89b131573b02bb92995ddf3f33d63a /bin
parenta0655a2088282eedc184dc3195b2eda0a01f2c83 (diff)
feat: simplified volume command
Diffstat (limited to 'bin')
-rwxr-xr-xbin/vol17
1 files changed, 17 insertions, 0 deletions
diff --git a/bin/vol b/bin/vol
new file mode 100755
index 0000000..ea7c7a0
--- /dev/null
+++ b/bin/vol
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+case $1 in
+ mute)
+ pactl set-sink-mute @DEFAULT_SINK@ toggle
+ ;;
+ [+-]*%)
+ pactl set-sink-volume @DEFAULT_SINK@ $1
+ ;;
+ *)
+ exit 1
+esac
+
+PID=$(ps -a | awk '/status/ {print $1; exit}')
+if [ $PID ]; then
+ kill -35 $PID
+fi