lassekongo83 / adw-gtk3

The theme from libadwaita ported to GTK-3
GNU Lesser General Public License v2.1
1.55k stars 57 forks source link

Questions Re: adw-gtk3 vs adw-gtk3-dark #249

Closed Bvngee closed 11 months ago

Bvngee commented 11 months ago

Prerequisites

Checklist to make sure the issue is not on your end

Description

This is most likely not and issue, but rather questions that I have that I cannot seem to find concrete answers to online. I apologize in advance if this is the wrong place to ask.

Firstly: Why does there need to be two separate themes for light and dark mode (adw-gtk3-dark and adw-gtk3) while each theme ALSO has a gtk.css and a gtk-dark.css? I notice that this seems to be a common trait among other GTK themes as well. While try to figure out how to hot-switch running GTK applications between light and dark mode, this has become a large point of confusion for me. I currently run this:

# switch to dark mode
gsettings set org.gnome.desktop.interface gtk-theme adw-gtk3-dark # or using `dconf`
gsettings set org.gnome.desktop.interface color-scheme 'prefer-dark'

# switch to light mode
gsettings set org.gnome.desktop.interface gtk-theme adw-gtk3
gsettings set org.gnome.desktop.interface color-scheme 'prefer-light'

which seems to work for running GTK3 and GTK4 apps. But what exactly is happening? Are they actually switching between the separate themes, or just loading the gtk.css or gtk-dark.css? With the apps I've tested, the GTK3 ones seem to perform the switch when changing the gtk-theme value, whereas the GTK4 ones switch when changing the color-scheme value. Does that mean only the GTK3 apps are doing the former, and the GTK4 apps are just using the different css files?

As a final question: My ideal scenario would be using custom light and dark variations of adw-gtk3/libadwaita, colored using named variables (like what Gradience does), and live switching between those at runtime as well. Would it somehow be possible to do that? My gut is telling me no but I'm confused as to what's even going on so I figured I might as well ask. Thank you very much for this theme and for your time, and sorry again if this is the wrong place to ask these questions!

OS and version [e.g Fedora 37]

NixOS 23.11

Adw-gtk3 version. Also specify your installation source. [e.g tar.xz, AUR, git main branch]

5.1, nixpkgs 23.11

GNOME version

N/A (I use Hyprland on Wayland)

Application name and version (If the issue is with an app.)

N/a

lassekongo83 commented 11 months ago

As for the gtk.css and gtk-dark.css css files - In the light theme gtk-dark.css is just for allowing individual apps to use the dark theme. In the dark theme both files use the dark style.

You can always create ~/.config/gtk-3.0/gtk.css with named variables and then programmatically with a shell script change color values depending on what you want to do. But you can't switch themes live with those config files, you'll need to restart apps or relog.