[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#53458: [Request, Linux] Follow system dark mode user preference
From: |
Rudolf Schlatte |
Subject: |
bug#53458: [Request, Linux] Follow system dark mode user preference |
Date: |
Sun, 23 Jan 2022 12:02:44 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.2 (darwin) |
Po Lu via "Bug reports for GNU Emacs, the Swiss army knife of text
editors" <bug-gnu-emacs@gnu.org> writes:
> Maximiliano Sandoval <msandova@protonmail.com> writes:
>
>> Recently a new setting was added to xdg-desktop-portal to declare the user
>> preference for a dark mode. This setting is DE-agnostic¹ and it is sandbox
>> friendly. The dark mode setting 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 its next release.
>>
>> How to implement
>
> Isn't the window manager and GTK+ responsible for this, and not the
> applications themselves?
The OS changes the title bar color etc., but such a change would let
Emacs adapt frame contents, for example by changing the active theme.
To give a concrete example, I have the snippet below in my init file,
evaluated when I'm running Yamamoto-san's Mac port:
(add-hook 'mac-effective-appearance-change-hook
#'(lambda () (pcase (plist-get (mac-application-state) :appearance)
("NSAppearanceNameDarkAqua"
(modus-themes-load-vivendi))
("NSAppearanceNameAqua"
(modus-themes-load-operandi)))))