lassekongo83/adw-gtk3

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

Bvngee opened this issue · 1 comments

Prerequisites

Checklist to make sure the issue is not on your end

  • I have made sure that I do not have multiple versions of the theme installed. Only one version should be installed in either ~/.local/share/themes or /usr/share/themes or ~/.themes
  • The file ~/.config/gtk-3.0/gtk.css does not exist. (If it does, backup and remove it.)
  • I have logged out and in again.
  • Dark theme only. I have enabled adw-gtk3-dark in gnome-tweaks AND set the appearance to dark in gnome-control-center
  • The flatpak theme is installed org.gtk.Gtk3theme.adw-gtk3 and org.gtk.Gtk3theme.adw-gtk3-dark
  • The app I'm having an issue with is an actual GTK3 app and is not coded using another toolkit like GTK2, GTK4, QT, etc.
  • I have created a new user profile without any modifications except adw-gtk3.

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

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.