]> git.armaanb.net Git - bin.git/blob - audio-set
Autostart: Switch to a picture wallpaper and picom
[bin.git] / audio-set
1 #!/usr/bin/env bash
2 # When changing volume, if muted, unmute
3
4 if [[ ${1} ]]; then
5   [[ $(amixer sget Master | tail -n 1 | grep "off") ]] &&
6     pactl set-sink-mute 0 toggle
7   pactl set-sink-volume 0 ${1}%
8   mutes="Unmuted"
9 else
10   pactl set-sink-mute 0 toggle
11   mutes="Muted"
12 fi
13
14 dunstify -h string:x-canonical-private-synchronous:audio \
15   "Volume" "${mutes}" \
16   -h int:value:"$(amixer sget Master | tail -n 1 | cut -d '[' -f 2 | \
17   head -c +2)" \
18   -t 1000