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

Automatic night mode and dark styles support #608

Open
nekohayo opened this issue Apr 2, 2021 · 9 comments
Open

Automatic night mode and dark styles support #608

nekohayo opened this issue Apr 2, 2021 · 9 comments
Labels
enhancement low-hanging-fruit "Easy picks" suitable for new contributors to tackle priority:low

Comments

@nekohayo
Copy link
Member

nekohayo commented Apr 2, 2021

Since GTG 0.5 has a dark mode setting in the preferences, I guess I should point out that it ought to have an accompanying "Automatic" dark/night mode feature available, where the dark mode gets turned on automatically at sunset and off at sunrise. Because manually managing this is "not the user's job" (unless they want to have the same theme no matter what the hour), in my opinion.

The basic/primitive way to do this would be to use the app's internal clock (since it already knows the time, using that to update the dates at midnight etc.), but the "optimal" way would be, when available on the system, to use GNOME's night mode (connecting over DBus or something?) so that it happens with the rest of the desktop and benefits from its heuristics (as it takes into account timezone/DST/seasons/etc., I think) and/or plugging into the new Freedesktop dark mode standard (supported by GNOME 42+ and Elementary's Pantheon)

@diegogangl
Copy link
Contributor

Wait, gnome has a night mode?

@nekohayo
Copy link
Member Author

nekohayo commented Apr 2, 2021

It doesn't control dark mode (I use my own silly script for that, which I've never taken the time to release publicly and announce, and it's a silly hack), but it does control what we used to call "red shift", so that's something I imagine you could plug into: in the Control Center, in the "Displays" panel, "Night Light" section.

@diegogangl
Copy link
Contributor

Ah ok, there was some talk about auto-changing apps to dark mode but I didn't know if it was eventually added.

For anyone attempting this, look for toggle_darkmode() in application.py. You also need to refresh the treeviews for the background colors, so look at the darkmode toggle code in general_preferences.py

@azmeuk
Copy link

azmeuk commented Jun 1, 2021

To add some context: there is (at least) one GNOME extension that switches GTK themes at sunset/sunrise. Most of the GTK apps works very well with that, and some apps have an "automatic theme detection" so non-GTK content matches the global theme (for instance, the dark reader firefox extension con only awake when the global gtk theme is dark).

The extension can also trigger user-written scripts at theme switch, this is how I automatically switch my vim and alacritty themes.

@nekohayo
Copy link
Member Author

nekohayo commented Mar 3, 2022

I guess the whole paradigm changes with GNOME 42 and GTK4, where there will be a global dark mode preference thingy that will eventually become automatable natively by the user in GNOME 43 (I presume), so this might get easier in the future, as we don't really have to bother with the whole timing thing; instead, I think we'll need GTG to "react" to the system and apply colors correctly, so that means dealing with:

@nekohayo nekohayo changed the title Automatic dark mode Automatic dark mode and dark styles support Mar 3, 2022
@nekohayo nekohayo changed the title Automatic dark mode and dark styles support Automatic night mode and dark styles support Mar 3, 2022
@idoric
Copy link

idoric commented Apr 3, 2022

I allow myself to add two references that could be useful to implement the support of the system-wide dark style preference in GTG:

@GeoffreyCoulaud
Copy link

Hey, any idea if this has anyone on it ?
This is pretty important since many users use dark mode and the color palette makes it unusablein GTG at the moment.

@idoric
Copy link

idoric commented Sep 23, 2023

This is pretty important since many users use dark mode and the color palette makes it unusablein GTG at the moment.

I think we need to separate two problems:
— Problem 1: following the system-wide dark style preference (the issue we find ourselves on)
— Problem 2: having a good color palette for dark mode (issue 844)

GTG already offers a dark theme, fixing problem 1 is mainly a service to users whose system automatically switches between light theme and dark theme depending on whether it is day or night (for example thanks to the "Night Theme Switcher" GNOME extension). A user who does not use GTG urgency colors does not suffer too much from the color palette problem, and even so he may prefer not to have an application that remains bright in the middle of a dark environment at night.

As for problem 2, it concerns those who would like to use the dark theme, but cannot/do not want to in its current state, and fixing it would not help eliminate problem 1.

What I mean is that the two problems are quite distinct, and neither has priority over the other. At most we can notice that by solving problem 2, there will perhaps be even more users interested in solving problem 1.

@nekohayo
Copy link
Member Author

Yes, we will get to all of this, once we complete the GTK4 port as part of #737.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement low-hanging-fruit "Easy picks" suitable for new contributors to tackle priority:low
Projects
None yet
Development

No branches or pull requests

5 participants