configuration/local/bin/sslider.sh

10 lines
438 B
Bash
Raw Normal View History

2016-12-14 09:56:38 +01:00
#!/bin/sh
2020-12-04 14:45:07 +01:00
control="$(amixer scontrols | sed -n "1s/.*'\(.*\)'.*/\1/p")"
2020-12-04 14:45:07 +01:00
uplimit="$(amixer get "$control" | grep "Limits:" | tr -s ' ' | cut -d' ' -f6)"
lolimit="$(amixer get "$control" | grep "Limits:" | tr -s ' ' | cut -d' ' -f4)"
current="$(amixer get "$control" | sed -n '/dB/{p;q}' | sed 's/.*Playback \([0-9]*\) .*/\1/')"
wjt -l "$lolimit" -u "$uplimit" -x "$current" | while read next; do
2020-12-04 14:45:07 +01:00
amixer -q set "$control" "$next"
2016-12-14 09:56:38 +01:00
done