

If you are using KDE and want to switch dark and light modes on the fly (even at the cost of different themes for Qt and GTK apps), you can switch the GTK theme to one that supports both dark and light variant - like the default Adwaita theme. You can switch to Adwaita theme by running the command below. Notably, if you are using KDE, the Breeze GTK theme does not support it. Note that not all GTK themes support both light and dark variants. $ gsettings set color-scheme 'prefer-light'

$ gsettings set color-scheme 'prefer-dark' $ gsettings set gtk-theme " new-theme"Īlternatively, if your theme does not apply the dark scheme to Gtk4 applications, you can request the dark variant of the default theme:

Gsettings is queried for Wayland sessions. $ xfconf-query -c xsettings -p /Net/ThemeName -s " new-theme"Ĭhanges to this entry are instant and affect all GTK applications. $ xfconf-query -c xsettings -p /Net/ThemeName The xsettings daemon from Xfce is xfsettingsd, which is provided by the xfce4-settings package. For desktops running with Wayland, gsettings is queried. For desktops running with Xorg, an xsettings daemon is needed. To switch themes instantly for running programs, either a daemon providing the xsettings spec or gsettings is required. To permanently change to the dark variant, see GTK#Dark theme variant For example the default GTK theme Adwaita has the variant Adwaita-dark. Most themes do have a dark variant and those have by convention the suffix -dark. To change the light/dark mode, you have to change the used theme. Running custom scripts is also supported. Currently it supports Plasma, GNOME & Budgie DE, as well as few of the most used miscellaneous applications (Firefox, VSCode etc.). Yin-Yang - Yin-Yang is a similar tool, which can be also run manually (not only on sunset/sunrise).It allows placing drop-in scripts to be run automatically at those times. darkman - darkman is a tool that allows automating transitioning to dark mode at sundown, and back to light mode at sunrise.If you don't need live theme switching, to quickly set a dark theme system-wide Install gnome-themes-extra, adwaita-qt5 and adwaita-qt6 and Export GTK_THEME=Adwaita:dark, GTK2_RC_FILES=/usr/share/themes/Adwaita-dark/gtk-2.0/gtkrc and QT_STYLE_OVERRIDE=adwaita-dark. Switching between light and dark mode requires support from applications or application toolkits like GTK and Qt. This article focuses on switching at runtime, so toggling during use affects currently running programs. The switch between themes can apply to currently running programs, probably requiring a daemon, or only to newly launched ones. It allows you to switch to dark mode on sunset or toggle modes with a keyboard shortcut. Switching between light and dark modes/themes is nice to have. Reason: GNOME 42 has been released, which has built-in dark mode switching.
