Support xdg-desktop-portal dark mode
- Dominant language
- Emacs Lisp
- Stars
- 22.7k
- Forks
- 3.1k
- Avg merge
- 10h 46m
- Merged PRs (30d)
- 4
Description
Recently a new [setting](https://flatpak.github.io/xdg-desktop-portal/#gdbus-org.freedesktop.portal.Settings) was added to xdg-desktop-portal to declare the user preference for dark mode. This setting is DE-agnostic¹ and it is sandbox friendly.
How to implement: Emacs has to read via dbus the value of the setting and subscribe to changes, then set the value of the GtkSetting property [gtk-application-prefer-dark-theme](https://docs.gtk.org/gtk3/property.Settings.gtk-application-prefer-dark-theme.html) so that the headerbar of emacs follows the preference, and optionally set the `doom-theme` to something that makes sense.
Note that desktops will likely implement scheduling based on the time of the day, so apps have to be able to read this setting on the go.
1. it will be officially supported in GNOME 42, elementary OS already supports it and there is a merge request for KDE that will most likely included in the next release.
### Briefly explain its use-case
Avoid this:

Contributor guide
Assessment
This issue has not been assessed yet.