-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
[bug] Tauri does not detect system theme preference on Linux #9427
Comments
The I wasn't able to replicate the theme detection problem with Adwaita on Ubuntu 22.04.4 (GNOME 42) and Ubuntu 23.10 (GNOME 45) after installing If possible, can you install The WebKitGTK implementation discussed in https://bugs.webkit.org/show_bug.cgi?id=197947 reads the 1_light_yaru-light_yaru-light_light |
In many recent distributions the The theme found by neofetch is From what I understand, new versions of GNOME (and KDE) now use the freedesktop standard
Sources: |
Yep, one approach could be to use the ashpd crate (or bespoke D-Bus bindings maintained in tauri) to ask the Settings portal for the freedesktop.org-standardised color-scheme value, and to also subscribe to changes to the color-scheme value |
I think this is solved via tauri-plugin-theme right? I tried it and it now automatically follows the theme selector on GNOME. |
Can you check if you have the same problem using vanilla js? (without vue etc.) |
It was a bit of a pain due to |
@MatthewScholefield which tauri version you use, i use tauri 1.5.3 and add tauri-plugin-theme, met issue: .plugin(tauri_plugin_theme::init(tauri::generate_context!().config_mut())) |
@Yanyan99999 See wyhaya/tauri-plugin-theme#13 (comment) Also though I'm using Tauri 2 which I think most people should start moving to anyways. |
Describe the bug
In my application I use the
prefers-color-scheme
media to change the color scheme of my app. It works on Chrome/Firefox/Epipahny (on Linux) but not on Tauri. I tried listening totauri://theme-changed
for what Tauri sees but the result is alwayslight
even if dark mode is enabled in GNOME.Reproduction
tauri://theme-changed
for theme changes or directly print theappWindow.theme()
promiselight
returns even if a dark theme is active in the systemExpected behavior
I expect it to return
dark
if the system is using a dark theme.Full
tauri info
outputStack trace
No response
Additional context
For instance, I am using the default theme (Adwaita) in GNOME 44.8. I also managed to reproduce the same issue using Tauri v2.
The text was updated successfully, but these errors were encountered: