diff --git a/README.md b/README.md index 1dbe419..185b7cc 100644 --- a/README.md +++ b/README.md @@ -79,6 +79,7 @@ Options: * $VOL_LEVEL * $ICON_SINK * $SINK_NICKNAME + * $IS_MUTED (yes/no) Default: $VOL_ICON ${VOL_LEVEL}% $ICON_SINK $SINK_NICKNAME --icons-volume [,...] Icons for volume, from lower to higher. diff --git a/pulseaudio-control.bash b/pulseaudio-control.bash index e5e5ffc..69c4eb4 100755 --- a/pulseaudio-control.bash +++ b/pulseaudio-control.bash @@ -98,9 +98,9 @@ function getNicknameFromProp() { } # Saves the status of the sink passed by parameter into a variable named -# `isMuted`. +# `IS_MUTED`. function getIsMuted() { - isMuted=$(pactl list sinks | grep -E "^Sink #$1\$" -A 15 | awk '/Mute: / {print $2}') + IS_MUTED=$(pactl list sinks | grep -E "^Sink #$1\$" -A 15 | awk '/Mute: / {print $2}') } @@ -172,7 +172,7 @@ function volMute() { fi if [ "$1" = "toggle" ]; then getIsMuted "$curSink" - if [ "$isMuted" = "yes" ]; then + if [ "$IS_MUTED" = "yes" ]; then pactl set-sink-mute "$curSink" "no" else pactl set-sink-mute "$curSink" "yes" @@ -266,7 +266,7 @@ function showOSD() { fi getCurVol "$curSink" getIsMuted "$curSink" - qdbus org.kde.kded /modules/kosd showVolume "$VOL_LEVEL" "$isMuted" + qdbus org.kde.kded /modules/kosd showVolume "$VOL_LEVEL" "$IS_MUTED" } @@ -322,7 +322,7 @@ function output() { getNickname "$curSink" # Showing the formatted message - if [ "$isMuted" = "yes" ]; then + if [ "$IS_MUTED" = "yes" ]; then # shellcheck disable=SC2034 VOL_ICON=$ICON_MUTED echo "${COLOR_MUTED}$(eval echo "$FORMAT")${END_COLOR}" @@ -362,6 +362,7 @@ Options: * \$VOL_LEVEL * \$ICON_SINK * \$SINK_NICKNAME + * \$IS_MUTED (yes/no) Default: $FORMAT --icons-volume [,...] Icons for volume, from lower to higher.