xfce-night-switch is a day/night GTK theme switcher for XFCE with a panel launcher, graphical settings dialog, Terminator terminal profile sync, location-aware scheduling, and full i18n.
The problem: XFCE has no built-in dark mode schedule. Terminator has no way to auto-switch terminal profiles when the system switches between dark and light modes. Existing solutions are either genmon plugins requiring manual polling, Python packages with heavy dependencies, or simple scripts with no GUI.
The solution: A self-contained bash toolset — a panel launcher with an arrow menu, a graphical settings dialog (yad) for theme and icon selection, and sunrise/sunset scheduling with zero runtime dependencies beyond what ships with a standard XFCE desktop.
| Feature | xfce-night-switch | xfce4-night-mode | AutomaThemely | xfce4-theme-switcher |
|---|---|---|---|---|
| Panel launcher with icon | ✅ | GenMon text | ❌ | ❌ |
| Live icon changes day↔night | ✅ | ❌ | ❌ | ❌ |
| Graphical icon picker (96+ icons) | ✅ | ❌ | ❌ | ❌ |
| GTK theme selector (scans) | ✅ | ❌ | ❌ | ❌ |
| Terminator profile sync | ✅ | ❌ | ❌ | ❌ |
| Monitor brightness dimming | ✅ | ❌ | ❌ | ❌ |
| Icons scaled to panel size | ✅ | ❌ | ❌ | ❌ |
| Time-based schedule | ✅ | ✅ | ✅ | ❌ |
| Sunrise/sunset by location | ✅ | ✅ | ✅ | ❌ |
| City search (OpenStreetMap) | ✅ | ❌ | ❌ | ❌ |
| GUI settings dialog | ✅ | ❌ | ✅ | ❌ |
| Panel selection (multi-panel) | ✅ | ❌ | ❌ | ❌ |
| Multi-language UI | ✅ en/ru/custom | ❌ | ❌ | ❌ |
| No Python/pip dependencies | ✅ | ✅ | ❌ | ✅ |
| .deb package | ✅ | ❌ | ❌ | ❌ |
| One-command install | ✅ | ✅ | ✅ | ❌ |
bash <(curl -fsSL https://github.com/prostopasta/xfce-night-switch/releases/latest/download/install.sh)Checks for missing prerequisites, downloads the latest .deb, installs with sudo dpkg -i.
git clone https://github.com/prostopasta/xfce-night-switch.git
cd xfce-night-switch
bash install.shxfce-night-switch-setup # or: bash ~/.local/bin/auto-update.shsudo dpkg -r xfce-night-switch # remove (keeps config)
sudo dpkg -P xfce-night-switch # purge (removes config too)Installed automatically by the install script. For manual installs:
sudo apt install yad curl wget python3 python3-dbus cron
# Optional (for SVG/PNG icon rendering in settings):
sudo apt install imagemagick
# Optional (for monitor brightness dimming):
sudo apt install ddcutil i2c-tools ┌─────────────────────────────────────────┐
│ XFCE Panel (dynamic ID) │
│ ┌──────────┐ ┌──────────────────────┐ │
│ │ ☀️/🌙 │ │ ⚙️ Theme Settings │ │
│ │ (toggle) │ │ (arrow menu item) │ │
│ └────┬─────┘ └──────────┬───────────┘ │
└───────┼───────────────────┼─────────────┘
│ │
toggle-theme.sh │ theme-settings.sh │
│ │
┌─────────────────▼───────────────────▼────────────────┐
│ GTK Theme switch │
│ xfconf-query + gsettings + xfwm4 theme │
└──────────┬───────────────────────────────────────────┘
│
┌─────────────┼───────────────────┬─────────────────────┐
│ │ │ │
▼ ▼ ▼ ▼
Terminator Panel icon update Monitor Dimming auto-theme.sh
profile switch (launcher-N/*.desktop) (eDP / ddcutil/xrandr) (cron, every min)
(DBus) day ☀️ / night 🌙 time or location
The launcher is installed at ~/.config/xfce4/panel/launcher-N/ where N is a free plugin ID ≥ 100, detected automatically and saved to ~/.config/xfce-night-switch/config. Two entries:
- Left item — toggle between day/night theme instantly
- Arrow — opens settings dialog
The panel icon updates on every toggle and every cron run (every minute). If you have multiple panels, the installer detects the one with the clock and places the launcher there. You can move it via Settings → Panel launcher.
theme-settings.sh is a yad-based GUI with these sections:
┌────────────────────────────────────────────────┐
│ Theme Switcher Settings │
├──────────────────────┬─────────────────────────┤
│ 🌙 Night icon │ Tango • weather.. │
│ ☀️ Day icon │ Humanity • clear │
│ 🎨 Themes │ [opens theme dialog] │
│ 🖥️ Panel launcher │ panel-0 (plugin-100) │
│ ⏱️ Auto-switcher │ ✓ By location │
│ 🔆 Monitor Dimming │ ✓ Enabled (ddcutil) │
│ 🌐 App language │ English │
│ 🔄 Restart panel │ │
└──────────────────────┴─────────────────────────┘
Theme dialog (🎨 Themes) scans /usr/share/themes/ and ~/.themes/ for installed GTK themes. Pick separate themes for day and night mode. Same for Terminator profiles — reads ~/.config/terminator/config and lists available profiles.
XFCE has no built-in way to switch Terminator terminal profiles when the system dark/light mode changes. This is a common pain point — Terminator's profiles are static and there is no hook for system theme changes.
xfce-night-switch solves this by:
- Switching the active profile for all open Terminator windows via DBus on every toggle or schedule event
- Updating the
profile =setting in layout blocks of~/.config/terminator/configso new terminal windows open with the correct profile
Setup:
- Create two profiles in Terminator: Preferences → Profiles (e.g.
light-themeanddark-theme) - Open theme-settings → 🎨 Themes — pick the profiles in the day/night dropdowns
- Done — Terminator will switch automatically
If you don't use Terminator, set both profiles to default — no effect.
| Package | Used for | Standard on XFCE |
|---|---|---|
bash 4+ |
All scripts | ✅ |
yad |
Settings GUI dialogs | Usually yes |
xfconf-query |
Panel & XFCE configuration | ✅ XFCE |
gsettings |
GTK theme & color-scheme switching | ✅ GLib |
curl, wget |
Geolocation, releases & updates | ✅ |
python3 |
NOAA sunrise/sunset solar calculation | ✅ |
python3-dbus |
Terminator profile switching via DBus | apt install python3-dbus |
| Package | Used for | Installation |
|---|---|---|
imagemagick / librsvg2-bin |
High-res SVG & PNG icon rendering | sudo apt install imagemagick |
x11-xserver-utils (xrandr) |
Multi-monitor software brightness dimming | Pre-installed or sudo apt install x11-xserver-utils |
ddcutil / i2c-tools |
Hardware DDC/CI monitor brightness control | sudo apt install ddcutil i2c-tools |
No pip install, no virtualenvs, no Node.js.
Config lives at ~/.config/xfce-night-switch/config:
# GTK themes — use 'theme-settings' GUI to pick from installed themes
LIGHT_THEME="Adwaita"
DARK_THEME="Adwaita-dark"
# Terminator profiles (must match [[ProfileName]] in ~/.config/terminator/config)
TERM_PROFILE_LIGHT="default"
TERM_PROFILE_DARK="default"
# Icons
ICON_DAY="weather-clear"
ICON_NIGHT="$HOME/.local/share/icons/hicolor/scalable/apps/theme-moon.svg"
# Scheduling
AUTO_SWITCHER="enabled" # enabled | disabled
AUTO_MODE="time" # time | location
DAY_START="07:00"
DAY_END="18:00"
LATITUDE="" # used in location mode
LONGITUDE=""
APP_LANG="en" # en | ru | custom code
# Monitor brightness dimming (optional)
MONITOR_DIMMING="disabled" # enabled | disabled
DIMMING_EXT_METHOD="xrandr" # xrandr | ddcutil
DIMMING_EDPI_DARK="70"
DIMMING_EDPI_LIGHT="100"
DIMMING_EXT_DARK="50"
DIMMING_EXT_LIGHT="100"Edit via theme-settings GUI or directly. The file is never overwritten on reinstall.
cp ~/.config/xfce-night-switch/locales/en.sh ~/.config/xfce-night-switch/locales/de.sh
nano ~/.config/xfce-night-switch/locales/de.sh
# Select in settings: App language → desunrise-sunset.py uses the NOAA Solar Calculator algorithm implemented in pure Python stdlib. Accuracy: ±1 minute for most latitudes. Calculated times are cached in ~/.cache/xfce-night-switch/sun_times for offline resilience. Polar regions (above 66°N / below 66°S) with midnight sun or polar night fall back to time-based mode.
| Project | Stars | Approach | XFCE panel | GUI | Location |
|---|---|---|---|---|---|
| bimlas/xfce4-night-mode | 109⭐ | GenMon plugin, shell | Text only | ❌ | ✅ |
| C2N14/AutomaThemely | 202⭐ | Python, multi-DE | ❌ | ✅ | ✅ |
| UdeshyaDhungana/xfce4-theme-switcher | 10⭐ | Shell | ❌ | ❌ | ❌ |
| xfce-night-switch (this) | — | Shell + yad | ✅ icon+menu | ✅ | ✅ |
We welcome contributions of all kinds! Please see CONTRIBUTING.md for detailed instructions on local development, running tests, conventional commit conventions, and the automated PR test gate.
MIT — see LICENSE.