-
Notifications
You must be signed in to change notification settings - Fork 274
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Respect OS Do Not Disturb mode #788
Comments
:/ I don't think Electron has a built in way to tell if DND is enabled. Looks like Electron recommends using this library https://github.com/felixrieseberg/electron-notification-state which only has one commit... maybe it's just really stable and good at it's current state? |
That felixrieseberg library just wraps two other libraries for fetching mac/windows notification states (also written by felixrieseberg, and with 7 and 9 commits respectively). Scanning the code it does look feasible that it might just work? |
As explained in element-hq/element-web#13941, the same happens in linux. |
The Do Not Disturb mode on gnome is the dconf setting |
#133 should hopefully address folks on GNOME |
Just to be clear, the preferred way on MacOS is to use the notifications API, so that do-not-disturb mode and other OS behavior is consistent. |
Electron does not support accessing that API seemingly, but closest we can get is to try and read the DND state using https://www.electronjs.org/docs/tutorial/notifications#do-not-disturb--session-state |
Op here. FWIW, for me this was solved by migrating to the web version, to PWA app within Chrome to be exact. |
Electron refers to the same package of felixrieseberg in there official docs, but in the package's GitHub repo I found more than one issue complaint that this package is deprecated for the newer versions of node, I think it's a bad Idea to rely on it in element. |
@tawfiek In general, I think this is a good idea. It always seems suspect to me to rely on 3rd party libraries whose code has not been audited and which cannot be absolutely authenticated. AFter all, this is communication software for private data... |
We have a do not disturb mode in user settings now. We could hook the OS level setting to honour that user preference. From what I understand we will only be able to do that on the Electron side as the media queries are not exposing any of that |
This was removed from labs in matrix-org/matrix-react-sdk@4d7b7c4 and I miss it dearly. |
There seem to be a user space lib to detect dnd mode on mac: https://github.com/felixrieseberg/macos-notification-state My workaround is to close element app when I'm expecting to focus on work. Not ideal one may say /sarcasm |
surely there is a way 4 years later to use the native notification system and get do not disturb following for free, right? Is this not annoying others? |
There is some related spec work (currently not progressing): matrix-org/matrix-spec-proposals#3026 |
Hi @HarHarLinks , the mentioned specs are unrelated to this bug. They are a great feature, but the bug here is about being a good platform citizen as a desktop app. |
I would really like this feature to be implemented. Element is the only application I run on my desktop (Fedora Linux 38 with KDE Plasma Desktop) that does not respect the system-wide do-not-disturb setting. Even Slack (also an Electron app) respects the setting properly. |
Here's a PR from Mattermost, another electron-based messenger, implementing this: |
@uzantome looks like it only supports Linux & Windows, and would create extra cost on the latter as it'd require signing extra binaries |
Description
In macOS there is a special mode called "Do not disturb" (DND). It is designed for cases when you need to focus on something or you just merely need to disable all notifications (imagine being on a talk but still being connected to the internet). If you activate this mode apps become silent, all notifications are not shown, etc.
However, it seems like that the Riot macOS app doesn't respect this setting and still will produce sounds. This is not solvable with individual notification settings (basically there is too many people you actually want to keep notifications while not in DND) and it is awkward to disable all notifications settings because it is too easy to forget to turn them off and turn them off again only for one app.
Version information
MacOS 10.14.1
Version 0.17.6 (0.17.6)
The text was updated successfully, but these errors were encountered: