34 lines
923 B
Bash
Executable file
34 lines
923 B
Bash
Executable file
#!/usr/bin/env bash
|
|
|
|
down() {
|
|
pamixer -d 2
|
|
volume=$(pamixer --get-volume)
|
|
[$volume -gt 0 ] && volume=`expr $volume`
|
|
notify-send -a "Volume" "Decreasing to $volume%" -h int:value:"$volume" -i ~/icons/low-volume.png -r 2593 -u normal
|
|
canberra-gtk-play -i audio-volume-change -d "changevolume"
|
|
}
|
|
|
|
up() {
|
|
pamixer -i 2
|
|
volume=$(pamixer --get-volume)
|
|
[ $volume -lt 1000 ] && volume=`expr $volume`
|
|
notify-send -a "Volume" "Increasing to $volume%" -h int:value:"$volume" -i ~/icons/high-volume.png -r 2593 -u normal
|
|
canberra-gtk-play -i audio-volume-change -d "changevolume"
|
|
}
|
|
|
|
mute() {
|
|
muted="$(pamixer --get-mute)"
|
|
if $muted; then
|
|
pamixer -u
|
|
notify-send -a "VOLUME" "UNMUTED" -i ~/.config/dunst/assets/ui/volume_high.svg -r 2593 -u normal
|
|
else
|
|
pamixer -m
|
|
notify-send -a "VOLUME" "MUTED" -i ~/.config/dunst/assets/ui/volume_muted.svg -r 2593 -u normal
|
|
fi
|
|
}
|
|
|
|
case "$1" in
|
|
up) up;;
|
|
down) down;;
|
|
mute) mute;;
|
|
esac
|