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 'Auto' option to icon and set depending on dark mode system pref #721

Closed
wants to merge 1 commit into from

Conversation

fnune
Copy link

@fnune fnune commented Oct 22, 2024

This PR is a draft to add a PreferDarkModeListener to Variety that can have callbacks registered to it in order to notify parts of the app of whether the user prefers dark mode or light mode at an OS level.

It is currently only being used to set the icon to Dark or Light automatically. But it could be used to choose wallpapers of a certain tone if the user wants that.

⚠️ I have not tested this PR yet and am posting it just to gauge interest. I will see if it works and productize it if people want this.

Would fix: #722

This PR is a draft to add a `PreferDarkModeListener` to Variety that can
have callbacks registered to it in order to notify parts of the app of
whether the user prefers dark mode or light mode at an OS level.

It is currently only being used to set the icon to Dark or Light
automatically. But it could be used to choose wallpapers of a certain
tone if the user wants that.

:warning: I have not tested this PR yet and am posting it just to gauge
interest. I will see if it works and productize it if people want this.
@fnune
Copy link
Author

fnune commented Oct 22, 2024

Actually the intitial .get_property is working fine for me under Plasma 6 but I am not getting notified when the global theme changes. Might have to do something OS-specific. I'm not an experienced desktop app developer.

@peterlevi
Copy link
Member

peterlevi commented Jan 8, 2025

I can see some potential future value in implementing a tighter dark vs. light mode integration in Variety, but I don't think the added complexity here is worth it just for the purposes of controlling the icon. Also on my machine, both light and dark mode use a blackish color for the system bar at the top...
I.e. I think it would make sense to add something like this only if we have more real uses for it.
At the current state of things, I feel if anyone needs controlling things in Variety based on the selected theme (e.g. switch the type of wallpapers they see), this could happen via external scripting - your PR can easily become such a general-purpose external tool that allows the user to run commands whenever they switch their theme.
Variety allows a ton of scripting options, including for setting the icon, or even for configuring two different profiles (one for light, one for dark) and switching between them using variety --profile profile-name.

@fnune
Copy link
Author

fnune commented Jan 8, 2025

I think such a tool already exists, e.g. there is darkman. So that may be used for that part, and I agree that it seems possible and perhaps even desirable to keep it out of Variety.

As for the icon in the system tray not changing colors: I personally perceive that as a bug (already reported in #722). Depending on the system Variety runs in, a dark icon could be very hard to see and use. That being said, I am not a (good) desktop applications developer so I don't know how to solve this any better. Perhaps there are in-built methods that are widely supported by host OSs that I don't know the existence of.

Let me close this PR and leave it here as (mis?)inspiration for others.

@fnune fnune closed this Jan 8, 2025
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.

Change system tray indicator icon to Dark or Light depending on OS dark mode preference
2 participants