#!/usr/bin/env bash # When changing volume, if muted, unmute if [[ ${1} ]]; then [[ $(amixer sget Master | tail -n 1 | grep "off") ]] && pactl set-sink-mute 0 toggle pactl set-sink-volume 0 ${1}% mutes="Unmuted" else pactl set-sink-mute 0 toggle mutes="Muted" fi dunstify -h string:x-canonical-private-synchronous:audio \ "Volume" "${mutes}" \ -h int:value:"$(amixer sget Master | tail -n 1 | cut -d '[' -f 2 | \ head -c +2)" \ -t 1000