summaryrefslogtreecommitdiff
path: root/.config/eww/scripts/getvol
diff options
context:
space:
mode:
Diffstat (limited to '.config/eww/scripts/getvol')
-rwxr-xr-x.config/eww/scripts/getvol9
1 files changed, 9 insertions, 0 deletions
diff --git a/.config/eww/scripts/getvol b/.config/eww/scripts/getvol
new file mode 100755
index 0000000..9fbe60f
--- /dev/null
+++ b/.config/eww/scripts/getvol
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+RUNNING_SINK=$(pactl list sinks | awk '
+ /^Sink #/ {sink=$2}
+ /State: RUNNING/ {print sink}
+' | head -n1)
+
+pactl list sinks | grep -A 20 "^Sink $RUNNING_SINK" | grep '^[[:space:]]Volume:' | \
+ head -n $(( $SINK + 1 )) | tail -n 1 | sed -e 's,.* \([0-9][0-9]*\)%.*,\1,'