Graphite-gtk-theme icon indicating copy to clipboard operation
Graphite-gtk-theme copied to clipboard

Dark mode not work at all for gtk4/libadwaita applications

Open sandikata opened this issue 2 years ago • 8 comments

Hello,

I tried way too many possible things to fix out dark mode for libadwaita/gtk4 but it still using light variant.

Any assistance here ?

Regards.

изображение

On right is legacy app (gnome-tweaks with gtk3) on the left is gnome-settings (libadwaita)

sandikata avatar Apr 12 '23 07:04 sandikata

Switching between Standard and Dark mode doesn't do, nothing (until i delete Graphite theme from ~/.themes)

sandikata avatar Apr 12 '23 07:04 sandikata

Some ugly workaround was to remove gtk.css: symbolic link to /home/rosen/.themes/Graphite-Light-nord/gtk-4.0/gtk.css and link it to the dark ones, but now light mode not work at all. Is it there any consistent way to make them both work ?

sandikata avatar Apr 12 '23 07:04 sandikata

Nope since gnome team removed support for custom themes, dark mode can not switch, because link gtk4 theme to config folder is not a perfect fix for this

vinceliuice avatar Apr 12 '23 09:04 vinceliuice

Nope since gnome team removed support for custom themes, dark mode can not switch, because link gtk4 theme to config folder is not a perfect fix for this

Is there any mod or patch for gnome that changes the "dark mode" function? 🙏🏻

Tuxino88 avatar Sep 27 '23 13:09 Tuxino88

Nope since gnome team removed support for custom themes, dark mode can not switch, because link gtk4 theme to config folder is not a perfect fix for this

I personally use CSS import directive to import the theme's gtk.css into my local css : @import url("/home/zr/.themes/Graphite-blue-Dark-compact-nord/gtk-4.0/gtk.css"); My theme is inside .themes 'couse flatpak cant read global path. It doesn't fix the issue about changing theme variant on the fly but it is mutch easier than symlinking and you can also have custom css in your ~/.config/gtk-4.0/gtk.css

Zetta1Reid0 avatar Oct 03 '23 19:10 Zetta1Reid0

I personally use CSS import directive to import the theme's gtk.css into my local css : @import url("/home/zr/.themes/Graphite-blue-Dark-compact-nord/gtk-4.0/gtk.css");

Could you please elaborate a bit further? In which css file to you use the import directive?

leoniscsem avatar Jun 28 '24 21:06 leoniscsem

I personally use CSS import directive to import the theme's gtk.css into my local css : @import url("/home/zr/.themes/Graphite-blue-Dark-compact-nord/gtk-4.0/gtk.css");

Could you please elaborate a bit further? In which css file to you use the import directive?

Gtk reads gtk.css from its config directories , thus ~/.config/gtk-4.0/gtk.css (For Gtk4). So instead of symlinking themes' gtk.css in the gtk4 config directory I just import the themes' gtk.css into the beginning of the config dir gtk.css file . But that is in the past. Now I just use a patched libadwaita that supports theming ( https://aur.archlinux.org/packages/libadwaita-without-adwaita-git ). As for flatpak I just use the GTK_THEME env variable, since I have no idea how to build "Gnome Platform" runtime.

Zetta1Reid0 avatar Jun 29 '24 03:06 Zetta1Reid0

  1. Install night theme switcher Extension.

  2. Set a Manual Schedule & Keyboard Shortcut

  3. Rename gtk.css from light theme to gtk-light.css

  4. Rename gtk.css from dark theme to gtk-dark.css

  5. Copy & Paste both files in the $HOME/.config/gtk-4.0/ folder

  6. Edit Command section Sunrise -> gsettings set org.gnome.desktop.interface gtk-theme 'Graphite-blue-nord'; gsettings set org.gnome.desktop.interface icon-theme 'Tela'; ln -fs $HOME/.config/gtk-4.0/gtk-light.css $HOME/.config/gtk-4.0/gtk.css

    Sunset -> gsettings set org.gnome.desktop.interface gtk-theme 'Graphite-blue-Dark-nord'; gsettings set org.gnome.desktop.interface icon-theme 'Tela'; ln -fs $HOME/.config/gtk-4.0/gtk-darks.css $HOME/.config/gtk-4.0/gtk.css

  7. Replace GTK & Icon Theme name to your preferred Themes in the above command

t4saha avatar Jul 09 '25 06:07 t4saha