2016-12-14 09:56:38 +01:00
|
|
|
#!/bin/sh
|
2019-11-21 15:11:38 +01:00
|
|
|
card="$(aplay -l | sed -n 's/^card [0-9]*: \(\w*\).*/\1/p' | tail -1)"
|
|
|
|
control="$(amixer -c "$card" scontrols | sed -n "1s/.*'\(.*\)'.*/\1/p")"
|
|
|
|
|
|
|
|
uplimit="$(amixer -c "$card" get "$control" | grep "Limits:" | tr -s ' ' | cut -d' ' -f6)"
|
|
|
|
lolimit="$(amixer -c "$card" get "$control" | grep "Limits:" | tr -s ' ' | cut -d' ' -f4)"
|
|
|
|
current="$(amixer -c "$card" get "$control" | sed -n '/dB/{p;q}' | sed 's/.*Playback \([0-9]*\) .*/\1/')"
|
2017-01-17 11:38:50 +01:00
|
|
|
wjt -l "$lolimit" -u "$uplimit" -x "$current" | while read next; do
|
2019-11-21 15:11:38 +01:00
|
|
|
amixer -c "$card" -q set "$control" "$next"
|
2016-12-14 09:56:38 +01:00
|
|
|
done
|