It is the third day I try to set a dark theme in debian-10 template.
I tried to install it changing the theme in Gnome Tweaks (works well in Fedora, but not in Debian).
I tried to install all possible Gnome packages.
I tried this:
cd ~/.config/
mkdir gtk-3.0
cd gtk-3.0/
touch settings.ini
Add the following lines to settings.ini
[Settings]
gtk-application-prefer-dark-theme=1
when I open the file again it shows
gtk-application-prefer-dark-theme=0
I tried that
Works for some time, but then suddenly drops to =0 again.
Reinstalled debian-10 template, tried on other PC with Qubes 4.0 and every time it ignores my changes. Gnome Settings does not start, Gnome Tweaks no effect, dconf-editor no effect.
Seems like starting Gnome Tweaks drops it to zero. It is strange because the file always has u+rw permissions and changes in Gnome Tweaks have no effect on interface.
Hi @tvori-dobro I feel your pain. A couple of conclusions I reached after struggling with this for months:
If you have gnome-settings daemon running (e.g. Fedora) the config files are ignored (best case) or interfere (worst case) with the settings you make in gnome-tweaks. … so if you want to use gnome settings daemon and gnome tweaks, it’s probably best to just delete the settings.ini and the .gtkrc-2.0
I found that my qubes work best without gnome settings daemon (e.g. Debian, Debian-minimal). In that case set the DPI in /etc/X11/Xresources/x11-common using Xft.dpi: in the template … and make sure your qubes have both: ~/.config/gtk-3.0/settings.ini and ~/gtkrc-2.0. Mine look like this:
I put these files in the /etc/skel of the template so they get created automatically if I create a new qube based on that template.
To make sure QT apps look good too: in the template install qt5-style-plugins, gtk2-engines-murrine and gnome-themes-standard. Then in /etc/environment add these two lines:
I tagged you reply as a task, but it’ll take some time. What I forgot in my reply is how to make sure QT apps look good too: in the template install qt5-style-plugins, gtk2-engines-murrine and gnome-themes-standard. Then in /etc/environment add these two lines:
Hi Sven, does changing the font and font size work for you?
I’m fighting with this too now, currently in Debian 11. Dark mode works, via the gtk-application-prefer-dark-theme setting, but not setting the font or font size.
I have the same settings.ini content as yours, except also the gtk-application-prefer-dark-theme=1 line, so:
For me, the first line does control the dark theme (I can switch it on and off successfully), but the other lines, and in particular gtk-font-name does not take / is not applied at all.
Applications like Firefox and GEdit still have (relatively) huge font size.
Any hints about how to debug this further are much welcome.
I have ensured the gnome-settings-daemon is completely removed also, just in case.
Yes works in general in Debian 11 (minimal) as I described including firefox-esr. Don’t know about Gedit. Also my Debian 11 qubes are in-place upgrades from Debian 10. So it could be that there is a difference when one uses the Debian 11 template from the repo – maybe?
Thanks, that’s great to know, then I know I should keep trying
Ah, well, I tried an in-place upgrade from Debian 10 before as well, and changed to a fresh template to see if that would help … so the problem has to be something else. Hmm.
(Btw, also now confirmed that file is actually read, with strace:
$ strace gedit 2>&1 | grep settings.ini
access("/usr/share/gtk-3.0/settings.ini", F_OK) = -1 ENOENT (No such file or directory)
access("/etc/gtk-3.0/settings.ini", F_OK) = -1 ENOENT (No such file or directory)
access("/etc/xdg/gtk-3.0/settings.ini", F_OK) = -1 ENOENT (No such file or directory)
access("/home/user/.config/gtk-3.0/settings.ini", F_OK) = 0
openat(AT_FDCWD, "/home/user/.config/gtk-3.0/settings.ini", O_RDONLY) = 10
Just a short update: Unfortunately haven’t solved the problem yet, so has had to retreat to Fedora as a base image, as I couldn’t work effectively with huge fonts taking up all the screen estate (not that fedora is bad, but the change causes some trouble to my usual workflow).
If anybody else get this to work and has some further tips about things influencing the outcome here, I’m much interested.
Thank you — and all the commentators here and here — so much for your hard work! (For me, now, it was just a couple of hours. )
Summary for all users
dom0 darkened with ›Q‹ panel click-pop-up/System Tools/Appearance and /Window Manager. With Style ›Bluebird‹ and in dom0 Terminal setting the same background color as desktop, dom0 Terminal kind of floats on the desktop, I like it …
Fedora 34 VMs (as ›browser‹, orange, in the screenshot) darkened with gnome-tweak-tools, »Tweaks« in dom0 applications list.
Debian 11 VMs (as ›encryption‹, purple, in the screenshot) with /etc/environment, settings.ini and gtkrc-2.0 files/settings.
Background colors and fonts of Gedit and Terminal are, of course, adjustable within the apps itselves.
[So, fortunately, you/we all can avoid a nightmare called KDE (I know what I’m talking about).]
Xjeanjean on Microsoft Github / Qubes issue #2846 is right: Changing trayicon_mode in /etc/qubes/guid.conf doesn’t do anything in 4.1. White background remains, the enigmatic black border remains.
If anybody has hints how to darken Firefox Websites just with userChrome.css and userContent.css; no add-ons, of course — would be nice! I can’t find anything useful.
The Xfce global dark mode guide/summary is already there, and @sven has at least seen it.
As Sven’s obviously the dark mode expert — »struggling with this for months« —, I’m not sure about changing it into a wiki post. He can tweak it anyway, and wiki post would mean everybody with trust level 1+ could edit?
I have issues with this on Debian 12. The distro theme can change by using documented methods, but applications such as Chrome and firefox, xfce4-settings-manager etc do not get updated when the documented commands are issued.
I have compared fedora-XX-xfce template with debian-YY template with respect to their xfce initializations. While doing this I had installed some packages, but apparently one undocumented thing appears to be essential:
xfsettingsd --replace
Maybe other users can try this. I can switch between dark/light themes (including apps like firefox et al) by using from dom0
Can someone please explain how to set a custom/new GTK3 theme in debian minimal template, so it will affect all the rest VMs?
Where should I put it?
What should I run in the terminal?