use the default alsa card

This commit is contained in:
Felix Van der Jeugt 2020-12-04 14:45:07 +01:00
parent bfa9bc9483
commit fe5db6e793
No known key found for this signature in database
GPG Key ID: 58B209295023754D
1 changed files with 5 additions and 7 deletions

View File

@ -1,11 +1,9 @@
#!/bin/sh
card="$(aplay -l | sed -n 's/^card [0-9]*: \(\w*\).*/\1/p' | tail -1)"
#card=PCH
control="$(amixer -c "$card" scontrols | sed -n "1s/.*'\(.*\)'.*/\1/p")"
control="$(amixer 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/')"
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
amixer -c "$card" -q set "$control" "$next"
amixer -q set "$control" "$next"
done