Fix acpi volume ctl

This commit is contained in:
har0ke 2021-10-21 12:52:53 +02:00
parent f7040143be
commit bdc18145ac

View File

@ -8,20 +8,21 @@ fi
echo "$sinks"
for SINK in $sinks
for SINK in $sinks
do
volume=$(echo $1 | sed "s/%//g")
if [[ $volume =~ "+" ]] || [[ $volume =~ "-" ]]; then
volume=$(($(pactl get-sink-volume 0 | grep -o -E "[0-9]+%" | head -1 | sed "s/%//g") $volume))
if [[ "${volume}" =~ "-" ]]; then
volume=$(($(pactl get-sink-volume $SINK | grep -o -E "[0-9]+%" | head -1 | sed "s/%//g") $volume))
echo $volume
if [[ "${volume}" =~ "-" ]]; then
volume="0"
fi
if [ "${#volume}" -gt "2" ]; then
volume="100"
fi
fi
fi
echo "$volume"
pactl set-sink-volume $SINK $volume%
done