Skip to content
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

Implement freedesktop color scheme preference (New Dark theme setting standard) #5350

Open
colinkiama opened this issue Apr 2, 2022 · 2 comments

Comments

@colinkiama
Copy link

colinkiama commented Apr 2, 2022

Problem description

There are some Linux distributions right now like elementary OS that are strictly sticking to the standard so Sublime Text is always showing the light color scheme on there.

The old method of determining to show the dark theme based on the GTK Theme has stopped working and may no longer work for more distributions in the future as this standard has been implemented already in both GNOME and KDE.

Preferred solution

Implement the freedesktop color scheme preference: https://github.com/flatpak/xdg-desktop-portal/blob/d7a304a00697d7d608821253cd013f3b97ac0fb6/data/org.freedesktop.impl.portal.Settings.xml#L33-L45

Alternatives

The current way of doing things (using GTK Theme) may be useful to keep for figuring out whether to use dark theme or not in older distributions but won't be adopted for some distributions like "elementary OS" as stated above.

Additional Information

https://bugzilla.mozilla.org/show_bug.cgi?id=1734934
flatpak/xdg-desktop-portal#633
https://gitlab.gnome.org/GNOME/xdg-desktop-portal-gnome/-/merge_requests/12
https://blogs.gnome.org/alexm/2021/10/04/dark-style-preference/

@jnns
Copy link

jnns commented Jun 29, 2023

This affects both Sublime Text and Sublime Merge on recent versions of Gnome, KDE and possibly other environments that I don't know about.

Could you prioritize this issue for one of the next releases? 🙏🏻 It has been an issue for more than a year already.

@wout
Copy link

wout commented Sep 12, 2023

I can confirm this is still broken in both Sublime Text and Sublime Merge. Almost all the other apps I use follow the system's theme as expected. I'm on elementary OS 7.

auto-light

auto-dark

jtojnar added a commit to jtojnar/nixfiles that referenced this issue May 31, 2024
The default `auto` theme appears to use some heuristics based on GTK
theme colours to determine whether system should be using dark mode.
This worked fine with a proper dark GTK theme like `Adwaita-Dark` but
we abandoned it in 973aa09. Instead,
we force GTK apps that have not yet adapted to the modern XDG settings
portal-based color scheme detection to use a dark variant of the built-in
Adwaita theme with `gtk-application-prefer-dark-theme` GTK setting.
But this has no effect on Sublime Text.

Until Sublime Text adopts a proper color scheme detection
(sublimehq/sublime_text#5350),
we will hardcode a dark color scheme and the `Adaptive` theme,
which seems to determine darkness based on color scheme darkness.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants