ErikReider / SwayNotificationCenter

A simple GTK based notification daemon for SwayWM
GNU General Public License v3.0
1.16k stars 59 forks source link

[Bug] Notification keep showing even after dnd (do not disturb) is enabled #198

Closed mildred closed 1 year ago

mildred commented 1 year ago

Describe the bug

After activating the Do Not Disturb mode, notification keep showing

To Reproduce

  1. Install and enable swaync
  2. ~Install the Telegram desktop client via flatpak/flathub org.telegram.desktop~
  3. Enable do not disturb
  4. ~Telegram notification keep showing~
  5. Execute : notify-send -u critical Foo
  6. Notification is showing despite DND mode

Expected behavior Notification should not show up

Please provide logs if you're experiencing notification errors / bugs Nothing, I don't know how to get the details about a notification with swaync-client or is that possible. I believe the telegram notification have a critical urgency because the notification do not auto hide with default config (well, that's ~another issue and~ the reason why I enabled the DND mode in the first place).

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

Additional context ~The notification do not hide either despite a "timeout-critical": 5, in the settings~

mildred commented 1 year ago

This is apparently by design, urgent notifications are displayed even if there is DND set:

https://github.com/ErikReider/SwayNotificationCenter/blob/8a1ffcfd6f0eab565636103e3d9631ccec76d312/src/notiDaemon/notiDaemon.vala#L176-L182

And for some reason I could not always load my configuration file, probably because when dbus-activated, the path to my configuration file was not taken. The correct configuration file path is ~/.config/swaync/config.json (with the .json extension) and then it will always be picked up.

ErikReider commented 1 year ago

Yeah. It's in the spec that urgent notifications should always be displayed to the user.

What config location were you using?

mildred commented 1 year ago

I was using ~/.config/swaync/config instead and of course when swaync was executed by dBus it would not pick it up.

The problem wit hthis spec is that the application might not correctly set the urgency of the different notifications, it should be overridable by the user.