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

Add docs on how to set dark mode on linux. #13

Open
rukai opened this issue Feb 22, 2022 · 7 comments
Open

Add docs on how to set dark mode on linux. #13

rukai opened this issue Feb 22, 2022 · 7 comments

Comments

@rukai
Copy link

rukai commented Feb 22, 2022

Some docs on how to set dark mode on linux in the recommended XDG Desktop Portal dbus method would be appreciated.
I searched around but couldnt figure out how to set it up.

@Be-ing
Copy link
Collaborator

Be-ing commented Feb 23, 2022

This library does not set dark mode. It only reads the setting so you can make use of it in your application.

@rukai
Copy link
Author

rukai commented Feb 23, 2022

I realize that, I'm after a quick note in the readme on how to configure my system such that rust-dark-light will pick up either dark or light mode.
And I wouldnt fault you for closing this issue as out of scope, but I suspect I'm not the only one who will encounter this.

The problem from my perspective is I have an egui app that uses rust-dark-light under the hood which is causing it to show up as light-mode.
This is great and a fantastic use of this library.
The only problem is I have no idea how to change the preference to dark mode on my linux machine.
This is partially a problem of linux's fragmented configuration but I think at least documenting how a user could configure the configuration system with the highest priority (XDG Desktop Portal dbus) would go a long way.

@John-Nagle
Copy link

The only problem is I have no idea how to change the preference to dark mode on my linux machine.

In Ubuntu 20.04 LTS, Open the "Settings" tool. In the Appearance tab, Window colors have the options "LIght", "Standard", and "Dark". This affects most things on screen.

Unfortunately, rust-dark-light returns "Mode::Light" even for "Dark" mode.

@frewsxcv
Copy link
Owner

Unfortunately, rust-dark-light returns "Mode::Light" even for "Dark" mode.

Does anyone know if Ubuntu use a different system property than whatever we're reading from?

@ModProg
Copy link

ModProg commented Oct 8, 2022

For anyone stumbling here looking how to set dark mode without a GUI settings app:

gsettings set org.gnome.desktop.interface color-scheme prefer-dark

@fenhl
Copy link

fenhl commented Jul 26, 2023

Does anyone know if Ubuntu use a different system property than whatever we're reading from?

Looks like it. The command gsettings get org.gnome.desktop.interface color-scheme prints 'prefer-dark' or 'prefer-light' depending on what has been set in the Settings app.

Edit: There's some weirdness going on here. The gsettings command works successfully when run from within the Terminal app but not when run from Visual Studio Code's integrated terminal.

@nagua
Copy link

nagua commented Apr 10, 2024

For the record: The problem is that https://github.com/demurgos/detect-desktop-environment does not work correctly.
Ubuntu sets the XDG_CURRENT_DESKTOP to ubuntu:GNOME and detect-desktop-environment checks if the variable equals "GNOME".
I opened an issue about that here: demurgos/detect-desktop-environment#5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants