i3: Fix audio script.

This commit is contained in:
2016-04-12 19:40:12 +02:00
parent 980db50c86
commit bffd6d9972

View File

@@ -4,7 +4,7 @@
SINKNAME="alsa_output.pci-0000_00_1b.0.analog-stereo" SINKNAME="alsa_output.pci-0000_00_1b.0.analog-stereo"
# this is the worst # this is the worst
SINK=$(( $(pactl list sinks | grep "Name: " | grep -n "${SINKNAME}" | grep -o "^[[:digit:]]*") -1)) SINK=$(( $(pactl list sinks | grep "Name: " | grep -n "${SINKNAME}"$ | grep -o "^[[:digit:]]*") -1))
getvol() { getvol() {
echo $(pactl list sinks | grep "^[[:space:]]*Volume" | head -n $(( $SINK + 1 )) | tail -n 1 | grep -o "[[:digit:]]*%" | head -n 1 | cut -d "%" -f 1) echo $(pactl list sinks | grep "^[[:space:]]*Volume" | head -n $(( $SINK + 1 )) | tail -n 1 | grep -o "[[:digit:]]*%" | head -n 1 | cut -d "%" -f 1)