diff --git a/local/bin/sslider.sh b/local/bin/sslider.sh index f58dc7d..5007412 100755 --- a/local/bin/sslider.sh +++ b/local/bin/sslider.sh @@ -1,5 +1,7 @@ #!/bin/sh -current="$(amixer get Master | sed -n '/%/s/.*\[\(.*\)%\].*/\1/p' | head -1)" -wjt -x "$current" | while read next; do - amixer -q set Master "$next%" +uplimit="$(amixer get Master | grep "Limits:" | tr -s ' ' | cut -d' ' -f6)" +lolimit="$(amixer get Master | grep "Limits:" | tr -s ' ' | cut -d' ' -f4)" +current="$(amixer get Master | grep "Mono:" | tr -s ' ' | cut -d' ' -f4)" +wjt -l "$lolimit" -u "$uplimit" -x "$current" | while read next; do + amixer -q set Master "$next" done