doomemacs / doomemacs/core

Support xdg-desktop-portal dark mode

Open
#6,027 2 comments 3 reactions 0 assignees View on GitHub
help wanted is:feature os:linux re:themes status:undecided
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:

![image](https://user-images.githubusercontent.com/11528996/150654444-bb09fc29-e193-4a49-bc28-a97a66367b8b.png)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.