Skip to content

feat(Themes): add support for GTK3 dynamic theming#2523

Draft
euletheia wants to merge 1 commit into
AvengeMedia:masterfrom
euletheia:gtk3
Draft

feat(Themes): add support for GTK3 dynamic theming#2523
euletheia wants to merge 1 commit into
AvengeMedia:masterfrom
euletheia:gtk3

Conversation

@euletheia

Copy link
Copy Markdown
Contributor

'Proof of concept'

Instead of overriding named colors of all GTK3 themes via the config directory file, we only override named colors for each variant of the adw-gtk3 theme (light and dark), and let GTK3 apps switch theme variant depending on the value of org.gnome.desktop.interface color-scheme.

This implies :

  • that GTK3 apps will auto adjust their theme in real time, without having to restart them ;
  • and that we can get rid of the stylesheet duplicata in the gtk-light-colors.css matugen template1.

However, the main shortcoming of this method is having to rely on the adw-gtk3 theme being installed in the user themes directory2 when package managers will install it system-wide in /usr/share.

This also entails that theming GTK3 apps without adw-gtk3 (via the .config override) would no longer be provided by DMS (at least I did not write anything to provide a fallback/choice).

Eventually, I don't know on which side you think the burden should weigh, but a stable solution could be to vendor the theme3.

Obviously, considering the size of the change, I could have overlooked some issues, but I've been using this patch for roughly a week and it seems stable.

Screenshots

contrib_DMS.mp4

Footnotes

  1. At least my tests showed no blatant issue without those 8000 LOC.

  2. Considering they don't use the legacy $HOME/.themes folder.

  3. with a "dank" prefix to differentiate it from the original ?

Instead of overriding named colors of all GTK3 themes via the config
directory file, we only override named colors for each variant of the
adw-gtk3 theme (light and dark), and let GTK3 apps change themes
depending on the value of org.gnome.desktop.interface color-scheme.
@real-or-random

Copy link
Copy Markdown

This implies :

  • that GTK3 apps will auto adjust their theme in real time, without having to restart them ;

This will be great.

  • and that we can get rid of the stylesheet duplicata in the gtk-light-colors.css matugen template1.

This would probably also solve #1555 as a side effect.

This also entails that theming GTK3 apps without adw-gtk3 (via the .config override) would no longer be provided by DMS (at least I did not write anything to provide a fallback/choice).

Sounds acceptable to me. The current way of simply overwriting everything with the adw3 light theme is certainly not better.

Eventually, I don't know on which side you think the burden should weigh, but a stable solution could be to vendor the theme

If DMS is committed to adw-gtk3 anyway, it can also ship it. And if a prefix is added, this really keeps it separate from the system installation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants