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

[feat] set default color palette based on user preference #412

Merged
merged 1 commit into from
Apr 26, 2024

Conversation

elevenhsoft
Copy link
Contributor

Hi

Today tried libcosmic on Pop_OS with current Gnome implementation. The problem was with preferred color palette in libcosmic apps. I'm using light theme in my OS and apps was started always as dark theme. Before I was added these feature to my app when using Iced and it was working so considered to add this to libcosmic. I'm not sure if you want to see such features. The implementation is very simple based on gsettings app and color-scheme value. From my tests on pop os it's working. It should work everywhere where gsettings are installed, otherwise it will default to dark theme as before so nothing lost here :) Would be nice to see it implemented.

@mmstick mmstick merged commit 084ce30 into pop-os:master Apr 26, 2024
let current_desktop = std::env::var("XDG_CURRENT_DESKTOP");

if let Ok(desktop) = current_desktop {
if desktop.trim().to_lowercase().contains("gnome") {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This value would never be anything other than exactly GNOME on GNOME, this seems a bit error prone and unnecessary, the best list I could find of possible values in on this page on the arch wiki. This code only runs when xdg-portal is disabled right?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess it does match GNOME-Flashback which it probably should, I've never heard of it before, I guess it's very unlikely a desktop name would contain "gnome", but with other desktops like "kde" it's more likely to have collisions

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah maybe you are right. However pop-os return different value:

~ ❯ echo $XDG_CURRENT_DESKTOP
pop:GNOME

so it's in case some distros have this value set to something else than GNOME

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

Successfully merging this pull request may close these issues.

None yet

3 participants