Skip to content

Option to override Do Not Disturb#141

Open
joshuamegnauth54 wants to merge 1 commit intopop-os:masterfrom
joshuamegnauth54:dnd-override
Open

Option to override Do Not Disturb#141
joshuamegnauth54 wants to merge 1 commit intopop-os:masterfrom
joshuamegnauth54:dnd-override

Conversation

@joshuamegnauth54
Copy link

@joshuamegnauth54 joshuamegnauth54 commented Mar 4, 2026

Android and iOS support allowing apps to bypass DND. This is a useful feature because a user may want to mute notifications but only allow a certain app (such as email or an important messenger) to display notifications.


A good use case for this is school or work. A user can toggle DND but allow notifications from Slack or an email app. To test, you can try enabling DND then adding an app to the config file do_not_disturb_overrides or you can use notify-send.

In ~/.config/cosmic/com.system76.CosmicNotifications/v1

echo true >| do_not_disturb
echo "[\"SomeApp\"]" > do_not_disturb_overrides

The notification program has to be restarted in order to re-read the config, which is a limitation of cosmic-notifications that I'll try to fix soon.
UPDATE: It turns out that the app does reload the config and it works correctly. I'm not sure why it didn't work yesterday. 🤷‍♂️

pkill -f cosmic-notifications

^COSMIC Session will restart it so it's okay to just close it. You only have to do this if the config doesn't refresh on its own.

notify-send -a DifferentApp Test

This notification won't fire.

notify-send -a SomeApp Test

This notification will display.

Currently, this setting isn't exposed to the end user beyond editing configs. I implemented a settings page for notifications in pop-os/cosmic-settings#1878 which can be amended with this setting in a future PR.


  • I have disclosed use of any AI generated code in my commit messages.
    • If you are using an LLM, and do not fully understand the changes it is making to the code base, do not create a PR.
    • In our experience, AI generated code often results in overly complex code that lacks enough context for a proper fix or feature inclusion. This results in considerably longer code reviews. Due to this, AI authored or partially authored PRs may be closed without comment.
  • I understand these changes in full and will be able to respond to review comments.
  • My change is accurately described in the commit message.
  • My contribution is tested and working as described.
  • I have read the Developer Certificate of Origin and certify my contribution under its conditions.

Android and iOS support allowing apps to bypass DND. This is a useful
feature because a user may want to mute notifications but only allow
a certain app (such as email or an important messenger) to display
notifications.
@leviport leviport requested review from a team March 4, 2026 16:26
@garrettjwilke
Copy link

initial testing, i am unable to get any overrides working. when do not disturb is enabled, no notifications go through at all.

set dnd true -> set dnd overrides to SomeApp -> restart cosmic-notifications -> all notifications are blocked regardless of overrides

attempted reboot, attempted to enable then disable dnd...all notifications are blocked and cannot determine if this works or not as is

@joshuamegnauth54
Copy link
Author

The do_not_disturb_overrides config has to contain an array of strings that matches the app IDs exactly. So something like:

["SomeApp1", "SomeApp2", "SomeApp3"]

And then to test with notify-send:

notify-send -a SomeApp1 Test
notify-send -a SomeApp2 Test
notify-send -a SomeApp3 Test

And to test that other apps don't trigger notifications:

notify-send -a SomeApp4 Test

^The above steps work for me. It's important that the IDs match exactly. Also, /usr/bin/cosmic-notifications must be replaced with this build. Running this cosmic-notifications build standalone doesn't work (or at least is annoying to get to work 😆 ).

@mmstick
Copy link
Member

mmstick commented Mar 6, 2026

It may not be necessary. I think critical alerts are supposed to be allowed regardless of the DnD setting.

@mmstick
Copy link
Member

mmstick commented Mar 6, 2026

Though I suppose Android makes notifications configurable per app.

@joshuamegnauth54
Copy link
Author

Yep! Urgent notifications can bypass DND, but this covers the case where a user needs notifications muted except for notifications from important apps (e.g. work or school apps).

Copy link

@garrettjwilke garrettjwilke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i originally did not set the do_not_disturb_overrides correctly...after editing with the correct format, it works as intended.

@maria-komarova
Copy link

maria-komarova commented Mar 11, 2026

A better way to deal with the issue is to have per app notifications. Which is a larger question of if it could be easily implemented.

@joshuamegnauth54
Copy link
Author

@maria-komarova So, I think I can easily switch this to per app notifications. Would that be preferred instead? I was thinking something like three options that can be set per app:

  • Always enabled (App can always disable notifications, even if Do Not Disturb is toggled)
  • Enabled (Default; app can send notifications except if DND is enabled.)
  • Disabled (App can never send notifications; i.e. mute that app)

All apps default to "enabled" which is the current behavior. Users can allow apps to bypass DND (always enabled) or mute apps so they never display notifications (disabled).

@maria-komarova
Copy link

I need time to consider the design and I need to get a few other things out of the way so I'll get back to you on that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants