Guide: Xfce global dark mode in Qubes 4.0 / 4.1

Original forum link
https://forum.qubes-os.org/t/10757
Original poster
anon81475885
Editors
BEBF738VD, deeplow, skyvine, Szewcu, szz9pza
Created at
2022-04-12 20:28:56
Last wiki edit
2025-01-06 09:53:14
Revisions
11 revisions
Posts count
74
Likes count
37

This summary is based on (and quotes) the Qubes Community guide, this and that — especially @Sven’s extensive work, see also this thread.

Dom0, Fedora & Debian


The following text and screenshots describe how to change the default light theme to a global dark theme. It's just an example; feel free to adjust the appearance to your taste.

And here are the final results:

xfce-end-result|690x388, 75%

Dom0 Qube Manager, Dom0 Terminal, Fedora 35 VMs, Debian 11 VM; desktop background color #3B3941 (external full HD display)
qubes-applications-menu|468x500, 75%

Qubes Applications Menu is darkened as well
Note: Of course, several apps (e.g., Terminal and Gedit) can be styled in the app itself. Here, Dom0 Terminal’s background color is set to the desktop background color — because fusion. 😉

Dom0


Change Appearance

Change Style in Window Manager

Qubes tools

Most of the Qubes OS UI in dom0 is now Qt5 based and doesn’t adhere to the selected theme by default.

more info: https://wiki.archlinux.org/title/Uniform_look_for_Qt_and_GTK_applications

This can be remedied by: - using a native Qt style

sudo qubes-dom0-update adwaita-qt5
Then add QT_STYLE_OVERRIDE=adwaita-dark to /etc/environment. Reboot.

That avoid to install anything in dom0, but it require to review the few lines of code being added. qube-manager dark mode (built-in method)

Fedora 34 / 35


Install and use Gnome Tweaks

In templateVM:

sudo dnf install gnome-tweaks

Note: See How to update.

Notes: You have to do this in the templateVM and all appVMs; changes you make in the home directory of a templateVM will not reflect in the template based VM by design. For dispVMs see this.

If you want to use gnome-settings-daemon and Gnome Tweaks, it’s probably best to delete settings.ini and .gtkrc-2.0 (see following Debian section).

To make sure QT apps look good, too: In templateVM install qt5-qtstyleplugins, gtk-murrine-engine and gnome-themes-standard. Add QT_QPA_PLATFORMTHEME=gtk2 to /etc/environment.

Debian 10 / 11


In Debian, things are getting a little bit trickier …

AppVMs seem to work best without gnome-settings-daemon (see end of Fedora section above). In that case set DPI in /etc/X11/Xresources/x11-common using Xft.dpi: (probably 96) in template VM.

Make sure your appVMs have both ~/.config/gtk-3.0/settings.ini and ~/.gtkrc-2.0:

settings.ini

[Settings]
gtk-application-prefer-dark-theme=1
gtk-font-name=DejaVu Sans Book 12 
gtk-theme-name=Adwaita-dark
gtk-icon-theme-name=gnome
gtk-application-prefer-dark-theme=1 is not necessary, it's forces usage of dark variation of selected theme. Since we are choosing theme that is already Dark it can be omitted.

.gtkrc-2.0

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" 
gtk-theme-name="Adwaita-dark"
gtk-icon-theme-name="gnome"
Note: The icon theme name is the name of its directory, not the name property in its index.theme . According to: https://wiki.archlinux.org/title/GTK

Put these files to /etc/skel of the templateVM, so they get created automatically if you set up a new appVM based on that templateVM.

To make sure QT apps look good, too: In templateVM install qt5-style-plugins, gtk2-engines-murrine, and gnome-themes-standard. Then add these two lines to /etc/environment:

QT_QPA_PLATFORMTHEME=gtk2
QT_SCALE_FACTOR=1

This work for debian-11-minimal but for debian-11 You have to uninstall xsettingsd or edit ~/xsettingsd config file instead of using ~/.config/gtk-3.0/settings.ini and ~/.gtkrc-2.0.

Done!


To do? Darken Firefox websites and Thunderbird emails just with userChrome.css and userContent.css, not via extensions/add-ons.

Note: Some panel (applet) icons, e.g., NetworkManager — see ›global‹ screenshot at the beginning of this guide —, notification-daemon, Joplin and Keybase, remain with white instead of dark resp. transparent backgrounds. For NetworkManager icon, see Qubes issue #2846.