Guide: Xfce global dark mode in Qubes 4.0 / 4.1

Since the OP has had their account anonymised I have made the first post into a wiki so anybody can add the new changes / fixes, if you have the time.

I followed all the steps for dom0 but, while most things went dark, the Qubes Applications Menu is still not adapting properly: every now and then it goes dark, but after a reboot it’s white again, totally random.

To be specific:

  • I set the style to Adwaita-dark (also tried Graybird-dark and Arc-Dark followed by reboots but without luck);
  • I changed the Window Manager style to the ones proposed;
  • I installed qt5-qtstyleplugins
  • and added QT_QPA_PLATFORMTHEME=gtk2 to /etc/environment

Everything else in dom0 is stock, as in no other packages were installed and none removed

Do You think that the problem with setting theme under standard Debian VM deserve an official Issue? It is worth mentioning that I can’t apply theme not only by using config files, but also with gnome-tweeks and xfce4-settings. When I chose some theme Adwaita is still used instead of that theme, even after reboot. As I wrote before only thing that have some affect is gtk-application-prefer-dark-theme which forcing use of Adwaita-dark instead of light.

I have observed the same problem since a recent update and solved it by creating ~/.gtkrc-2.0 and ~/.config/gtk-3.0/settings files also in dom0. The filp side of it is that now you have to change those two for your changes in the XFCE settings app to take effect everywhere.

1 Like

All right, I am downloading the debian-11 template and will investigate. Stay tuned.

1 Like

@Szewcu debian-11 comes with a settings manager called xsettingsd, once you uninstall it using sudo apt purge xsettingsd the guide will work.

1 Like

Thanks again for Your help. Now it works. It also looks like an alternative solution can be editing ~/xsettingsd config file.

1 Like

Sorry for bother You again but now I found out that QT not applying theme. I install all 3 mentioned packages in template and add those two lines to /etc/environment. After shutting down template an start qBittorent it is still light. I try both solutions to apply theme to GTK, and any of them set theme to QT.

Found it. I copy first line with space at the end. So now it works.

1 Like

I found out that still I have some not darkened apps. They are: Libreoffice, RealVNC and Zoom. For Zoom I think it may be hard, but LibreOffice and RealVNC seams to use same graphic framework.

I can help with this one. Libreoffice has different GUI frontends. The one that gets installed by default is the “gen” aka generic X window interface. You can easily install either the libreoffice-gtk3 interface or libreoffice-kf5. The former being the framework on which Gnome is based, the later the one for KDE.

Normally I would simply recommend you install the -gtk3 one and be done. However there is a well-known and maybe Qubes-OS graphic interface specific issue discussed in this forum. Basically any kind of scrolling appears to consume 100% CPU time and slows the interface down in a way that is very annoying, maybe even unusable depending on your use case.

Luckily, if you install the -kf5 interface this problem doesn’t exist.

sudo apt install libreoffice-kf5 will do the trick. However, if you haven’t already you also want to run the following commands to make sure the Qt/KDE apps use your dark theme:

  • sudo apt install qt5-style-plugins gtk2-engines-murrine gnome-themes-standard
  • sudo nano /etc/environment … add line QT_QPA_PLATFORMTHEME=gtk2
  • in my case I had to also add a second line QT_SCALE_FACTOR=0.8 to make the scaling work, not sure if you need that one too

That should do it.

All right padawan, it’s time for you to fight your own fight. May the (web search) force be with you! … there is nothing Qubes OS specific about this. So chances are other folks wanted to have dark themes in RealVNC and Zoom too.

zoom dark mode linux … suggests to me there is a setting in the Zoom client.

Good luck!

1 Like

Hello Sven, those two files solved my issue but in return they created another one:

the text of the window manager became incredibly dark: black for the active window and dark gray for the others. (I’m referring to the text that’s in the colored portion of non-dom0 windows, like [dispxxx] Tor Browser).

Is there a fix for that aswell or is it something that I have to live with?

This is a property of the ‘Style’ you choose in the ‘Window Manager’ settings app. Many styles behave the way you describe, some don’t. That’s one reason I use the ‘B5’ style. Another is that ‘B5’ is one of a few styles that draws a clearly colored but unobtrusive border around the entire window.

1 Like

Ahh fair, I really was hoping for a way to manually change the font color as I find Greybird to be more eye-pleasing, but I guess we can’t win them all!
Trying Bluebird now, as this one also has the colored border you mentioned.

Thank you for the reply.

First, thanks for this guide @anon81475885 and @Sven.
Really appreciate this guide.

… still wonder why Dark or Solarized Dark themes are not the default … anyways, I have a few questions and comments.

Could you please explain this Firefox darken

in more details or point me to a how-to?

What do I have to do here exactly? My file contains:

! $Id$

! load color-specific resources for clients that have them
#ifdef COLOR
*customization: -color

! make Xaw (Athena widget set) clients understand the delete key
! this causes problems with some non-Xaw apps, use with care
! *Text.translations: #override ~Shift ~Meta <Key>Delete: delete-next-character()

For the debian-11 template dark theme setup, may I ask you to verify, correct and replace your description with a more step-by-step guide to avoid any misunderstanding.

In order to get the dark theme setup automatically to all newly generated (debian) AppVMs make following modifications

  1. Optionally, create a clone of your default debian-11 template. Open a dom0 terminal and command this:
[user@dom0 ~]$ qvm-clone debian-11 debian-11-dark-theme
  1. Open a debian-11(-dark-theme) terminal and create this new file:
user@debian-11:~$ sudo gedit /etc/skel/settings.ini

afterwards copy&paste the following into the settings.ini:

gtk-font-name=DejaVu Sans Book 12 
  1. Secondly, create this (hidden) .gtkrc-2.0 file:
user@debian-11:~$ sudo gedit /etc/skel/.gtkrc-2.0

and copy&paste these lines into it:

include "/usr/share/themes/Adwaita-dark/gtk-2.0/gtkrc" 
style "user-font" 
		font_name="DejaVu Sans Book" 
widget_class "*" style "user-font"
gtk-font-name="DejaVu Sans Book 12" 
  1. close the debian-11(-dark-theme) template and reboot your template:
user@debian-11:~$ sudo reboot
  1. For verification, create a new AppVM (dark theme) based on your debian-11(-dark-theme) and open Files.

As I edited the guide that’s not all. It will work for template based on debian-11-minimal. For standard debian-11 based template this settings files interfering with xsettingsd. So You have two options here. You can uninstall xsettingsd or You can instead of adding this two files edit and use ~/xsettingsd (dont know if adding edited version to skell will overwrite the default since I’m not try it).

And for Firefox I think it is TODO since OP not figured out yet how to do that. It is just a plan for the future.

Will I have to use gnome-tweaks for fedora, or is there another way as for debian?

This has nothing to do with Fedora vs Debian but whether an xsettings daemon is installed. I don’t have a full Fedora or Debian template installed currently – so I can’t easily check, but if memory serves me right they have xsettingsd installed by default. In that case you can either uninstall said daemon and use the file based approach or you have to use gnome-tweaks.

The way I usually check for a settings daemon is ps aux | grep settings.

Just tried to install gnome-tweaks in VM, change the theme and it look like the configs persist somewhere while gnome-tweaks and all dependencies gone after reboot of VM. I think using minimal template will be my next step. Now I just transitioned from debian into fedora for sys vms.

Does anyone know how to do a “Dark theme” for Fedora 36?
It is driving me crazy with old legacy app’s being dark and Fedora 36 app’s being bright white.

I just installed gnome tweaks in the VM set theme to dark (default dark adwaita since I’m not installing anything in the template). Reboot VM and have all apps apart from QT dark, and no tweaks and it’s dependencies installed. For minimal just use ~/.config/gtk-3.0/settings.ini and ~/.gtkrc-2.0 and it also work.