The dark theme (prefer-dark) does not work in fedora 39

Tried to enable the dark theme on fedora-39-gnome/minimal using gsettings/dconf, and it doesn’t seem to work in qubes. Has anyone run into this problem yet?

1 Like

These are the ones I usually try:
xfconf-query -c xsettings -p /Net/ThemeName -s "Adwaita-dark"
and
gsettings set org.gnome.desktop.interface color-scheme "prefer-dark"

1 Like

Yes, this is the same method I use. Unfortunately, it doesn’t work in fedora-39-gnome. I checked all the necessary gnome-settings-daemon packages, reinstalled xdg-desktop-portal, adwaita theme, libadwaita, and the dark mode toggle doesn’t work.

1 Like

Do you have adwaita-qt5 installed in your TemplateVM? Does it help

Did you try to edit your template’s /etc/environment file to include:

QT_STYLE_OVERRIDE=adwaita-dark

In my f39 minimals, dark-theme works as usual, so probably it could be something with some gnome package interfering.

1 Like
Adwaita-qt
QT_STYLE_OVERRIDE=adwaita-dark

Your suggestion is for QT based applications. I use qgnomeplatform for them without any problems.
In my case the dark gnome(libadwaita) theme is not working. I have checked the full template and the minimal template. I also upgraded fedora-38 to 39 and got the same effect with dark theme not working.

1 Like

As weird as this is, in your /etc/environment, add this line (in your TemplateVM):

XDG_CURRENT_DESKTOP=GNOME

This fixed dark-mode on mine.

1 Like

What are your other dconf settings? This doesn’t seem to work with either tha F39 or F40 templates for me.

1 Like

The only other setting I needed was the one specified above:
gsettings set org.gnome.desktop.interface color-scheme "prefer-dark"

And I am just using either Adwaita or Adwaita-dark, whichever is available

I figured out the problem. Besides what you said, gnome-shell also has to be present.

This is not in the Fedora 39 template by default.

The problem isn’t gnome-shell, it’s the gtk.css in ~/.config/gtk-4.0 it’s going to be used no matter what theme you try to load.

Just replace it with the gtk.css from the theme you want to use, but remember to add the “qubes-patch”

I doubt that is the case - why would installing gnome-shell fix it in my case? And I am trying this from a fresh template.

You can look up how libadwaita works.

~/.config/gtk-4.0/gtk.css straight up doesn’t even exist on normal Fedora though:

Yes it does, it has two files gtk.css and qubes-patched

It has this content.

/* QUBES BEGIN */
/* Do not modify text until end marker, it will get overriden on update */
/* See https://github.com/QubesOS/qubes-issues/issues/8081#issuecomment-1473412028 */
....
/* QUBES END */

I was talking about vanilla Fedora, not the qubes variant of it. And installing gnome-shell on the Qubes templates will just make it work, there is no need to manually copy gtk.css or applying the qubes patch.

This is the clearly better way to go around it, because you will get updates to your theme and don’t even need to care about copy pasting anything.

Have you actually tried it in the F39 template, or did you only test it in your vanilla installation?

For me, installing gnome-shell in the F39 template does nothing, except pulling in 250 MB in 27 packages, I’m not able to change the theme with gsettings.

I am testing it on the Qubes Fedora template. Did you turn the VM off, then turn it back on and try gsettings changes?

Oh, and on F39 I think you can get away with just gnome-session, I will double check. gnome-session alone is defo not enough on F40.

Edit: ignore this comment. I was hallucinating. You need gnome-shell installed as I previously said.

Read this thread: https://discourse.gnome.org/t/why-and-how-libadwaita-prevents-theming/17079

I doubt installing random GNOME packages is going to solve the problem (unless you downgrade to GNOME 44), you can style GTK3 apps without installing anything, and it will work with some of the GNOME tools, but you can’t style the GTK4 apps that use libadwaita.

This is the TLDR from the GNOME team

Then don’t use software, because all software places artificial restrictions.

Libadwaita provides the UI appearance and behaviours described in the GNOME human interface guidelines 6. If an application is using libadwaita then its authors have decided to follow the GNOME guidelines; any attempt at changing that is going to break the application’s intended user experience.

If a user wishes to inject their own styles into an already styled application, with no regards to the intent of the authors of that application, then they can, by using the facilities exposed by GTK—namely, adding styles to the $HOME/.config/gtk-4.0/style.css file that is automatically loaded. If you do that, you get to keep both the pieces when things inevitably break, and you don’t get to complain about it.

There is nothing in the licensing terms or development practice that says that application of library developers in free and open source software have to provide knobs and settings for people who want to modify applications and libraries without paying the cost of learning how to read and modify the code.

I do not know how this is relevant to the discussion. Installing gnome-shell just allows the “prefer-dark” gsettings to work. By default it doesn’t on Qubes’ template (it works fine on normal Fedora!!!)

I am not trying to inject any custom styling or anything like that. This is only for adwaita-dark to work.

gnome-shell isn’t a random GNOME package either. It is literally one of the core packages that is responsible for a lot of dbus interfaces and whatnot.

Did you try what I said above?

  • Make sure the /etc/environment has XDG_CURRENT_DESKTOP=GNOME
  • Install gnome-shell
  • Set the org.gnome.desktop.interface color scheme to “prefer-dark”
  • Reboot