merge: main

This commit is contained in:
aduhayon 2022-08-10 09:41:31 +02:00
parent 152e72294a
commit 64f848ec80
8 changed files with 20 additions and 15 deletions

View file

@ -1,7 +1,8 @@
#!/bin/bash
set -e
CUR="$(pactl get-sink-volume "@DEFAULT_SINK@" | awk '$1 == "Volume:" {print substr($5, 1, length($5) - 1)}')"
SINK='@DEFAULT_SINK@'
CUR="$(pactl get-sink-volume "$SINK" | awk '$1 == "Volume:" {print substr($5, 1, length($5) - 1)}')"
CUR="$((CUR - CUR % "$1"))"
case "${1:0:1}" in
@ -19,7 +20,7 @@ esac
[ "$NEW" -lt 0 ] && NEW=0
[ "$NEW" -gt 100 ] && NEW=100
pactl set-sink-volume "${SINK}" "$NEW"%
pactl set-sink-mute "${SINK}" 0
pactl set-sink-volume "$SINK" "$NEW%"
pactl set-sink-mute "$SINK" 0
echo "$NEW"