rifazn / dark-toggle

A small POSIX compliant shell script that toggles between the dark and light variants of a GTK theme.
MIT License
21 stars 0 forks source link

Doesn't work on themes that have more than two variants #1

Closed KarkanAlzwayed closed 3 years ago

KarkanAlzwayed commented 3 years ago
  1. It only changes the theme, not the shell theme. So, the panel, right-click on desktop menu, password box..etc stay at whatever previous theme it was on.

  2. It gets confused and doesn't work when a theme has several variants. For example, it worked flawlessly on Yaru and Pop themes, because they only have (Yaru and Yaru-dark.. and Pop and Pop dark), but when I try it on the zorin theme (which has zorin blue, zorin blue dark, zorin red, zorin red dark etc of other colors), Qogir (which has Qogir, Qogir win, Qogir dark, Qogir win dark, Qogir rounded, Qogir rounded dark....You get what I am saying), it doesn't do anything.

  3. I'd love for this to apply to icons, too.

  4. Automatic switching (sunset to sunrise, for example) would be superb.

rifazn commented 3 years ago

It only changes the theme, not the shell theme. So, the panel, right-click on desktop menu, password box..etc stay at whatever previous theme it was on.

Working on it. Thanks for reporting!

[...] when I try it on the zorin theme (which has zorin blue, zorin blue dark, zorin red, zorin red dark etc of other colors), Qogir (which has Qogir, Qogir win, Qogir dark, Qogir win dark, Qogir rounded, Qogir rounded dark....

Can you try the latest master against the Zorin themes? I've just pushed a patch. For the Qogir ones, can you please provide the exact names of the themes? I don't want to install a bunch of Qogir themes if possible. In which case, giving me the output of ls /usr/share/themes/Qogir* or ls ~/.themes/Qogir* (depending on how you installed the theme) should be enough.

I'd love for this to apply to icons, too.

Thanks. On it.

Automatic switching (sunset to sunrise, for example) would be superb.

Are you using a Desktop Environment (as opposed to using just a Window Manager)? In that case, I would suggest using Night Theme Switcher. Or if you are using a DE, you can try adding a hook for tools like Gammastep, or Red Shift. I have a gist for a gammastep hook that tries to do that: https://gist.github.com/rifazn/50b4fa6b297137756a0f97b655026967

KarkanAlzwayed commented 3 years ago
  1. It has worked on the zorin themes.
  2. here is the output for the Qogir (these are only the ones I use, it originally has more than these)
    
    /home/kalzi/.themes/Qogir:
    AUTHORS   COPYING      gtk-2.0  gtk-4.0      metacity-1  unity
    cinnamon  gnome-shell  gtk-3.0  index.theme  plank       xfwm4

/home/kalzi/.themes/Qogir-dark: AUTHORS COPYING gtk-2.0 gtk-4.0 metacity-1 unity cinnamon gnome-shell gtk-3.0 index.theme plank xfwm4

/home/kalzi/.themes/Qogir-light: AUTHORS COPYING gtk-2.0 gtk-4.0 metacity-1 unity cinnamon gnome-shell gtk-3.0 index.theme plank xfwm4

/home/kalzi/.themes/Qogir-win: AUTHORS COPYING gtk-2.0 gtk-4.0 metacity-1 unity cinnamon gnome-shell gtk-3.0 index.theme plank xfwm4



3. I am using Fedora workstation (gnome 40). That extension is actually very good and works just fine, but how is it going to work with your script? Wouldn't it eliminate the need for this script? I still think that you should implement an automatic switching in this script to make it complete.
rifazn commented 3 years ago

Hi @KarkanAlzwayed!

Can you see that it works for your themes now, please?

And for themes that don't work, can you try adding a theme mapping in the config file?

For using the config file, just copy the config file as ~/.config/dark-toggle/config (of course after cloning the repo or after pulling the latest changes).

You can add a theme mapping as:

theme_mapping="theme1-variantA: theme2-variantB"

This way, if your current theme is theme1-variantA, calling dark-toggle will change it to theme1-variantB, and vice-versa.

I have the thought that adding a custom user config gives us much more flexibility (as a user can have any theme combination they like), and also the code maintains a better quality (as data (theme names, etc.) is not getting hard-coded into the source).

KarkanAlzwayed commented 3 years ago

Hi there, apologize for the late response. I don't run gnome anymore, unfortunately. :/

rifazn commented 3 years ago

It's alright. I hope you'll let me know if anything breaks when you ever use it again!