Knowledge Base

Preserving for the future: Shell scripts, AoC, and more

My mute notification for Fluxbox and volumeicon

I use fluxbox, with volumeicon-alsa, and notification-daemon. I could use the bog-standard notifications that volumeicon provides, but the little icons in the notification are really small. So I wrote my own.

In ~/.fluxbox/keys, I react to the volume mute button:

#121 :Exec amixer sset Master,0 toggle
121 :Exec /usr/local/bin/

Instead of just toggling the mute with fluxbox, I call my special script at /usr/local/bin/

# Startdate: 2022-09-12
# For fluxbox
# handle the audio being muted and send cute notification
amixer sset Master,0 toggle 2>&1 | grep -iqE '\[on\]' 2>/dev/null && {
nid="$( cat "${tmpfile}" 1>/dev/null 2>&1 )"
notify-send --transient --expire-time 2000 ${nid:+--replace-id=${nid} }--icon "${ICON}" "Audio ${AUDIO}" --print-id | tee "${tmpfile}" 1>/dev/null 2>&1

I wanted the size 64 icons so I could see them! Also, I wanted the black icons because my default theme in notification-daemon is apparently the nice, boring gray that hides white icons.