Talk:Dark mode switching
GNOME 42
GNOME 42 has built-in dark mode switching, yet the article makes no mention of this. See https://release.gnome.org/42/. The new freedesktop standard should also be mentioned: https://github.com/flatpak/xdg-desktop-portal/blob/d7a304a00697d7d608821253cd013f3b97ac0fb6/data/org.freedesktop.impl.portal.Settings.xml#L33-L45 Sleeping (talk) 19:19, 7 May 2022 (UTC)
- Agreed that the current state seems to not explicitly mention automatic dark-mode switching in DEs like GNOME, but, as the article implicitly focuses on dark-mode switching for toolkits like gtk, I think it's geared more towards those without GNOME or KDE Plasma and doesn't warrant a blanket outdated flag.
- The article does mention xsettings now, which implements the freedesktop standard you link! Kjkent (talk) 23:39, 1 June 2024 (UTC)
This seems already resolved here https://wiki.archlinux.org/title/Dark_mode_switching#gsettings for some time. Slouchy (talk) 15:43, 10 March 2023 (UTC)
chromium
on my KDE plasma desktop, chromium is using the DBUS_SESSION_BUS_ADDRESS env to enable the chromium darkmode theme
tempdir=$(mktemp -d) env -i DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY DBUS_SESSION_BUS_ADDRESS=$DBUS_SESSION_BUS_ADDRESS chromium --user-data-dir=$tempdir rm -rf $tempdir
alternative: XDG_DATA_DIRS and GTK_THEME, where /themes/$GTK_THEME/gtk-2.0/gtkrc (and other theme files) must be in $XDG_DATA_DIRS
tempdir=$(mktemp -d) env -i DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY XDG_DATA_DIRS=$XDG_DATA_DIRS GTK_THEME=Breeze-Dark chromium --user-data-dir=$tempdir rm -rf $tempdir
probably chromium will also use other envs: QT_QPA_PLATFORMTHEME, QT_STYLE_OVERRIDE, ... Milahu (talk) 10:53, 14 January 2024 (UTC)
KDE
For changing the theme of KDE from the CLI one can use:
lookandfeelool -l # to enumerate themes lookandfeeltool -a <THEME NAME>
My bottles on drug (talk) 08:04, 27 May 2024 (UTC)
Improvement proposals from a user perspective
Yesterday I spent half a day setting up dark/light-mode switching on my freshly installed system. The arch wiki page is of great help, however I think it could be better.
I don't feel like I'm able to edit it because I did a lot of trial and error and I'm not sure if my findings are sufficiently general, elegant and simple (though for me everything works as I expect it now). I don't want to have automatic switching, so I completely disregarded the first section ("Tools"). However, investigating the `darkman`-package out of pure despair actually gave me very valuable hints. The second section describes what I want to do: change the theme (or scheme) for GTK and Qt applications manually.
But this is where it gets misleading:
1. Section 2.1.2 "gsettings" reads "gsettings is queried for Wayland sessions". This may be true or false, but somehow it implies it doesn't work for X sessions and since there's a X in the section title of 2.1.1 "xsettings daemon", I was very tempted to rather use the xsettings daemon. Anyway, gsettings works perfectly fine with my X setup (and xsettings doesn't), so maybe this should be reworded?
2. I don't use a desktop environment like Gnome or KDE. I have Gnome installed as fallback, but I use i3. I suppose many Arch users don't use a DE. Until yesterday, I've never heard the term "portal" in context of the linux world. Turns out, they are crucial and the dark mode wiki page should mention it. Section 3.1 on the XDG_Desktop_Portal page is the key, adding a link to that page might suffice.
3. qt6ct cannot be controlled by command line directly, so it's difficult to automate it. However, it's easy to change the Qt scheme without gui, too: https://github.com/trialuser02/qt6ct/issues/47 This should be mentioned, I think it was not documented anywhere, I had to inspect the source code of qt6ct to find this out.
4. Debugging. All of this is not hard. It only becomes hard when you don't get any feedback until it suddenly works. Every uncertainty (like should I use gsettings or xsettings?) lets the number of possibilities to try grow exponentially. Some hints on how to debug intermediate steps would be great (e.g., explain where helpful logs hide).
I'm thinking about writing an short article about how to set up dark/light mode switching on i3/Xorg. Would the wiki be a good place for that?
Thanks! Pasbi (talk) 14:17, 27 July 2024 (UTC)