In my previous post I described that I don’t like pop-up notifications and how I used urgency hints instead. While that setup worked, there was one big problem: Sometimes I would see that there is a notification but had no idea what it actually was. Clearly, I needed a better solution with the following requirements:
- It should be as distraction-free as possible. That’s why most notification systems don’t work for me since they mainly rely on pop-up notifications.
- I want to be able to figure out what the notifications are about. That is, there should be a way to read the whole notification somewhere.
- Notifications should not disappear after I looked at them. Marking them as read should be a manual action. I can’t or want always take action on them immediately.
Again, I am using Dunst. This time I’m taking advantage of its do not disturb
mode which I turn on by default. That way I prevent notifications from popping
up.
To see whether there are new notifications I use dunstctl in a small script
that I call in my waybar to show the current notification count:
#!/usr/bin/env python3
import subprocess
count = 0
count += int(subprocess.run("dunstctl count displayed",shell=True, capture_output=True).stdout)
count += int(subprocess.run(
"dunstctl count waiting",
shell=True,
capture_output=True
).stdout)
if count:
print(count)
Once I want to see the notifications I toggle the do-not-disturb mode with a key binding in my window manager. Once this is toggled, all notifications show or disappear.
I can now click on a notification to mark it as read or — what I usually do — mark all of them as read with a key binding.