Simple bash scripts to toggle light/dark mode on Linux Mint (XFCE) — both the system theme (GTK + xfwm4) and the icon theme.
- Linux Mint with the XFCE desktop
xfconf-querygsettingsnotify-send(desktop notifications)
Toggles the XFCE system theme (GTK + xfwm4) between light and dark.
Recognizes the Mint-L-* / Mint-Y-* theme family (e.g. Mint-L-Dark-Red ↔ Mint-L-Red). If the current theme doesn't match any known pattern, Adwaita-dark is used as the target.
It also sets the prefer-dark / prefer-light preference in org.x.apps.portal, used by Firefox and other apps running through xdg-desktop-portal (the xdg-desktop-portal-xapp backend) — the GTK theme name alone isn't enough for them.
Usage:
./toggle-theme.shToggles the XFCE icon theme between light (remembered variant, default Mint-Y) and dark (Papirus-Dark) — since there is no official Mint-Y-Dark theme.
The current light icon theme is remembered in the state file ~/.local/state/icon-theme-toggle-light, so switching back to light mode restores the exact variant that was active before.
Usage:
./toggle-icon-theme.shCopy the scripts to a directory in your PATH, e.g.:
cp toggle-theme.sh toggle-icon-theme.sh ~/.local/bin/
chmod +x ~/.local/bin/toggle-theme.sh ~/.local/bin/toggle-icon-theme.shYou can also bind them to a keyboard shortcut in XFCE settings (Settings → Keyboard → Application Shortcuts).
Open Source