Is there some way to prevent theme schedule reseting the icons theme?

Hi! I've been using zorin 17 since two months ago. My issue is, I like the default gtk theme and I want to use the automatic dark/light theme change, specifically this feature:

But the problem is, everytime the system changes the theme to light or dark the icons theme is reset to the default zorin icons. And I think I know why: the default Icons theme have two variants for each color: ZorinColor-Light and ZorinColor-Dark. The system probably is changing to ZorinColor-Light/Dark every time the gtk theme changes to make both gtk and icon themes match. But is a inconvenience since it don't let me use my preferred icons.

So, there's any way to make the theme schedule affect only the gtk theme but no the icons theme?

It really looks like Zorin Appearance is made to use the default Zorin OS styles only. I can see why they would do it this way in order to ensure consistency, but it would be great to have the option to allow icons to be changed independently of the theme. Perhaps we should move this to Feedback?

Maybe @Storm knows of a better way to handle this but I can offer you a work around using the command line:

gsettings set org.gnome.desktop.interface gtk-theme 'ZorinBlue-Light'

You can change the accent color and theme at the end of the command, and it would apply it without touching the icon set e.g., 'ZorinOrange-Dark'. While this alone is not very ergonomic, you can put this into a little script and have it run every so often to check whether or not is time to switch the theme:

#!/bin/bash

acc_color=Blue
cur_hour=$(date +%H)
start_hour=18
end_hour=6

if [[ $cur_hour -gt $start_hour || $cur_hour -lt $end_hour ]]; then
    gsettings set org.gnome.desktop.interface gtk-theme "Zorin${acc_color}-Dark"
else
    gsettings set org.gnome.desktop.interface gtk-theme "Zorin${acc_color}-Light"
fi

Save this file as something like "theme_toggler.sh" in your home folder. Then, type crontab -e and insert this line at the end.

*/30 * * * * $HOME/theme_toggler.sh

sc1

The first time you run this command you might be asked which text editor you want to use. If you don't know select 1 and hit enter. Then, add the line at the bottom which will instruct the system to run this script every 30 minutes. To save the changes press Ctrl+O and exit with Ctrl+X.

sc2

A couple of notes:

  • If you want to undo these changes, press crontab -e and delete the last line just as you did to add it in the first place.
  • Remember this runs every 30 minutes so if you turn on your computer at 18:05, you will only see the theme change at 18:35. You can edit the frequency of the script if you want by specifying something like */5 to run every 5 minutes. But unless this is really important to you, I would recommend as is to avoid wasting CPU (It's a very simple script, but still).
  • You can also change the start and end hours of the dark theme if you want in their respective variables in the script. Start being the time at which the dark mode kicks in.
  • As for the accent color, you can edit the script and change the variable acc_color to one of the valid values. Pretty straight forward, right?
  • Disable the Zorin Appearance scheduler so that it doesn't run anymore, otherwise you have two different mechanisms competing with each other for the same purpose which can be confusing.
2 Likes

FYI. I have amended the thread title for clarity, as the phrase "There's some way.." implies there is some way... i.e. here is a way to do it etc.

oh... is bcs I'm not a native englsh speaker

1 Like

hi @zenzen, thanks for your reply. I followed your isntructions and it worked very well, thanks. Only issue is the shell theme didn't change but thats okay, is a small thing.

I also did a small "improvement": created a .desktop file that executes the script and configured it to start with system using gnome tweaks. This way I will not have the issue with the computer taking 30 min to change the theme if i turn it on 18hrs like you mentioned.

About changing the topic to Feedback, I don't know, I'm new at this forum. If you think it will be better to move to the feedbacks feel free to do it.

Edit: I found a command to edit the shell theme on askubuntu forum and added it to the script

2 Likes

Do You make the Arrows and Markings in Your Pictures with Your Screenshot Tool or do You use an extra Program for that?

Nice catch, I didn't even realize that the taskbar wasn't changing. I've wrote a new version that fixes this and also makes sure that the background changes accordingly, something that I also missed before.
Remember that this is still a rudimentary script and acts only as a work around, but if you find any other issues let me know and I'll try to fix them.

This is the new script, all you have to do is replace the contents from the file you already have with this:

#!/bin/bash

accent_color=Blue
theme_color=Light
color_scheme='prefer-light'

start_hour=18
end_hour=6

current_hour=$(date +%H)

if [[ $current_hour -ge $start_hour || $current_hour -le $end_hour ]]
then
    theme_color=Dark
    color_scheme=prefer-dark
fi

theme_str="Zorin${accent_color}-${theme_color}"

gsettings set org.gnome.desktop.interface gtk-theme "$theme_str"
gsettings set org.gnome.desktop.interface color-scheme "$color_scheme"
gsettings set org.gnome.shell.extensions.user-theme name "$theme_str"

I'm using Flameshot for the arrows and markings. It's quite a handy program for this type of screenshots where things need to be pointed out.

2 Likes