Last active
December 1, 2021 15:10
-
-
Save eze-kiel/7171c64f9a5918cc3cad82da444f5b2b to your computer and use it in GitHub Desktop.
Use dunstify to get notified about volume percentage and mute toggle
This file contains 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
# i3 config relevant part | |
bindsym XF86AudioMute exec --no-startup-id "amixer -q set Master toggle; /path/to/notify-volume-mute.sh" | |
bindsym XF86AudioRaiseVolume exec --no-startup-id "amixer -q set Master 3%+ unmute; /path/to/notify-volume-set.sh" | |
bindsym XF86AudioLowerVolume exec --no-startup-id "amixer -q set Master 3%- unmute; /path/to/notify-volume-set.sh" |
This file contains 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 | |
status=$(amixer sget Master | tail -n 1 | awk '{print $NF}') | |
if [ "$status" == "[off]" ]; then | |
dunstify -t 500 -h string:x-dunst-stack-tag:volume Volume "🔇 muted" | |
else | |
dunstify -t 500 -h string:x-dunst-stack-tag:volume Volume "🔊 unmuted" | |
fi |
This file contains 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 | |
percent=$(awk -F"[][]" '/Left:/ { print $2 }' <(amixer sget Master)) | |
dunstify -t 500 -h string:x-dunst-stack-tag:volume Volume "🔊 $percent" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment