puavo-org / puavo-os

Puavo OS is an disk image based operating system that is built from Debian GNU/Linux and is specifically designed for learning.
https://puavo.org
GNU General Public License v2.0
13 stars 7 forks source link

Desktop darkmode to support also Dark gnome shell theme #668

Closed asokero closed 6 months ago

asokero commented 7 months ago

The Bookworm version of Gnome has added a "native Gnome-way" to select between Dark and Light UI modes. Currently this option only changes GTK-theme, Gnome-shell theme being unaffected. On ubuntu (as also Bookworm version of Puavo OS) both themes are changed.

tuomasjjrasanen commented 7 months ago

The style in appearance panel controls org.gnome.desktop.interface color-scheme.

By default, it's default, when style is switched to dark, the value is switched to prefer-dark. Note that it does not switch theme, it switches style (which is an alias to color-scheme.

Then there is org.gnome.desktop.interface gtk-theme which controls the theme GTK-apps are using.

And then there is yet another option, org.gnome.shell.extensions.user-theme name, which controls the GNOME Shell theme. It's Yaru-blue by default. (user-theme is GNOME Shell extension which can be used to swithc GNOME Shell theme. Oh boy.)

So, what we are aiming here, is to make the Style switch to actually switch themes.

So, in addition to controlling org.gnome.desktop.interface color-scheme, Style switch should control also org.gnome.desktop.interface gtk-theme and org.gnome.shell.extensions.user-theme name.

tuomasjjrasanen commented 6 months ago

PR #678 fixes this, but only with themes, which have dark alternative AND their dark alternative is prefixed with -Dark.

Our default theme is Arc and it's dark counterpart is Arc-Dark. But I just realized that dark alternative naming is not consistent across themes. For example, Yaru's dark alternative is Yaru-dark.

I will enhance the darkmode support by accepting -dark prefix as well.

tuomasjjrasanen commented 6 months ago

Ok, #678 had a bug: it switched Shell theme to GTK theme. #693 fixes the bug by handling/switching GTK and Shell themes independently.

asokero commented 6 months ago

Done and tested working!