Scheduled mode for dark theme

Alright Guys, this is the time for some serious talk, I know we all spent a lot of time on laptop and this is what I am thinking.
is it a possibility to enable and disable dark theme based on a schedule ?
Why, because it helps… Yes and be aware it helps that we have light theme in day light and in night dark theme. try it and let me know if it will not work for your eyes.
Thank You.

As long as you have a theme that has two variants one dark, one not then yeah should be able to knock up a bash script that will poke the gsettings key to switch the theme

gsetting set org.gnome.desktop.interface gtk-theme 'Pocillo'

gsetting set org.gnome.desktop.interface gtk-theme ‘Pocillo-dark’

So your bash script would be based around something like this

So if the time is nighttime then run the gsetting pocillo-dark otherwise run the pocillo gsetting command

I would run that bash script via a cron entry scheduled to run every 10 minutes so that it will cater for when you suspend/resume your computer.

Nice, I will give it a try then. thank you.

I may be missing something very basic and obvious, in which case apologies, but I’ve just come here to search for exactly this query : can I set the system to switch between light and dark theme based on TOD, and found this post. Is this still the way to make this happen on 23.04?

Thank you! :slight_smile:

Your bash script will also need to flip the prefer-dark/light value as per Theming changes in UB 22.04 and later