Talk:Dark mode switching

From ArchWiki
Latest comment: 14 January by Milahu in topic chromium

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)Reply[reply]

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)Reply[reply]

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)Reply[reply]