2026-01-12

Better Desktop Notifications

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:

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.