Last active
November 22, 2022 09:25
-
-
Save sharpicx/f4934e58a26dfd7610f9a218a50b11a8 to your computer and use it in GitHub Desktop.
pamixer increasing/decreasing volume notification using dunstify or notify-send and canberra-gtk-play used for audio.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
# Author: sharpicx | |
case $1 in | |
up) | |
pamixer -i 5 | |
volume="$(pamixer --get-volume)" | |
dunstify "VOLUME" "Volume get increasing to $volume%" -h int:value:$volume -i audio-volume-high | |
canberra-gtk-play -i audio-volume-change -d "changevolume" | |
;; | |
down) | |
pamixer -d 5 | |
volume="$(pamixer --get-volume)" | |
dunstify "VOLUME" "Volume get decreasing to $volume%" -h int:value:$volume -i audio-volume-low | |
canberra-gtk-play -i audio-volume-change -d "changevolume" | |
;; | |
mute) | |
pamixer -t | |
muted="$(pamixer --get-mute)" | |
if $muted ; then | |
dunstify "VOLUME" "Volume is getting muted!" -i audio-volume-muted-blocking -u low | |
else | |
dunstify "VOLUME" "Volume aint muted!" -i audio-volume-high -u low | |
canberra-gtk-play -i audio-volume-change | |
fi | |
;; | |
esac | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment