How can I get audible desktop notifications with i3?
Hey guys. All I want out of life is desktop notifications that play a sound. Why is this so hard? Here's what i've tried:
- I'm using i3 on Ubuntu, and I launch gnome-settings-daemon from my i3 config, so by default notify-osd is running. I cannot for the life of me configure notify-osd to play a sound. I've googled and googled and googled, everything says that you just have to select a sound theme in your gnome-control-center, well I've done that and notify-osd does not play a sound.
(I should mention, I know that my soundcard is working, because the sound config panel is able to play test sounds, and I can watch youtube videos, and other things can make sounds. But notify-osd does not make a sound. Ever.)
- Then I thought i would try out dunst. Dunst of course does not have any sound feature, but it has a feature to run a script. So I wrote a script that plays a sound! Here's the weird thing though: If I run dunst from a terminal, it works great! Plays the sound no problem. But when I start dunst from my i3 config, it totally fails. The first iteration of my script failed because I was using the 'play' command, which by default does not play any sound when run backgrounded. but then I switched it to 'play -q', confirmed that running my script backgrounded still plays a sound, but still running dunst from i3 config does not play a sound. What is going on here?!?!
here is my script:
$ cat .local/bin/dunst_sound.sh
#!/bin/sh -e
play -q /usr/share/sounds/gnome/default/alerts/glass.ogg
Here is the relevant part of my dunstrc:
[sound]
summary = "*"
script = ~/.local/bin/dunst_sound.sh
Aaaand here's the relevant part of my i3 config:
exec dunst &
exec gnome-settings-daemon
What have I done wrong here?
Please note, this question isn't "how can I make dunst play a sound". If there's some other notification tool that plays sounds, by all means please recommend it.
But I mean, what the heck is going on here?
- Running
play -q ...
in a terminal plays a sound. - Running
play -q ... &
in a terminal plays a sound. - Running
dunst_sound.sh
in a terminal plays a sound. - Running
dunst_sound.sh &
in a terminal plays a sound. - Running
dunst
in a terminal plays sounds when notifications come in. - Running
dunst &
in a terminal plays sounds... - BUT running dunst from my i3 config DOES NOT PLAY SOUNDS. Wut?
You could also use https://github.com/sboli/twmn ....you can specify a sound command for all notifications i.e. sound_command=/usr/bin/aplay /path/to/some/wav