Open rozniak opened 2 years ago
Use the Standardised Prefers Dark Theme setting.
gsettings: org.freedesktop.appearance color-scheme
from https://github.com/flatpak/xdg-desktop-portal/pull/633/files:
<member>0: No preference</member>
<member>1: Prefer dark appearance</member>
<member>2: Prefer light appearance</member>
@dominichayesferen That's cool - my only concern is, is there are info on how this will accompany GTK themes? It would be sweet to just be able to read a value but will it actually work when someone selects a 'dark mode' theme - whether there is some kind of metadata theme authors can provide to make it aware?
It's up to the Desktop Environments to set the value accordingly.
Guess will have to check to see how reliable it is, I'm not sure it will be outside of Adwaita / DE's own themes. I guess it should respect the setting if it's 1
or 2
, but if it's 0
then try to detect based on theme colours.
After porting the Royale Noir window decorations, I had a quick look to see what the system looked like with Royale Noir + Adwaita dark as people have said for years that Royale Noir would make a good dark theme. Here's how it looks:
Through this I notice
winver
obviously stands out. It would be nice if it could switch to a dark mode appropriate branding banner (say, transparent background with a white Windows flag) when a dark theme is active.Not sure there's any built-in API in GTK, so propose adding an API into
libcomgtk
to do the check. Potential solution here perhaps that could be incorporated into the project: https://lzone.de/blog/Detecting-a-Dark-Theme-in-GTK