appearance: Add a schedule to switch the style at set times

This adds a Schedule tab to the Appearance dialog: a list of rules "at HH:MM switch the style". The switching itself is done by a new xfsettingsd helper, so it works while the dialog is closed.

Each rule can, together or separately:

  • set the Gtk theme;
  • set the color scheme (org.gnome.desktop.interface color-scheme, read through the settings portal by GTK 4/libadwaita, Qt 6, Firefox, Chromium): Dark, Light or Default; a new rule pre-selects Dark if the theme name contains "-dark";
  • set the matching Xfwm4 theme (by default as the switch on the Style tab), the icon theme or the cursor theme;
  • run a shell command; a new rule comes with notify-send 'Scheduled style changes applied'.

Behaviour: a rule applies its settings when the clock reaches its time; a setting changed by hand stays until the next rule; a switch missed while logged out or asleep is made at login or on waking up. Rules are stored in the xsettings channel under /Xfce/ThemeSchedule/ as parallel string arrays. The theme lookup (theme directories, matching Xfwm4 theme) is shared by the Style and Icons tabs, the schedule and xfsettingsd in common/theme-utils.c.

Schedule tab Rule dialog

Testing: in use since October 2026 on Xubuntu 26.04 (Xfce 4.20) and 24.04 (4.18) as a patch, packaged at https://github.com/gtubolcev/xfce-patches. This branch is the same code ported to master (Meson build, G_DEFINE_FINAL_TYPE, g_set_str); it builds without warnings in the xfce/xfce-build image and passes clang-format-diff. Test scripts drive the dialog (xdotool on Xvfb) and xfsettingsd (rules of every kind; with faketime: the clock jumping forward and back, midnight, a time zone change), also built with AddressSanitizer: no memory errors, no leaks outside fontconfig. Debug output: XFSETTINGSD_DEBUG=theme-schedule.

Possible follow-ups (not in this MR): rules at sunrise/sunset; screen brightness (it was in an earlier version of this MR and was dropped in review; it would be a separate MR, through libxfce4ui or xfce4-power-manager).

AI disclosure: this code was written with the help of an AI assistant (Claude, by Anthropic), as stated by the Co-Authored-By trailers of the commits.

🤖 Generated with Claude Code


Closes: #482 (closed)

Edited by Grigory Tuboltsev

Merge request reports

Loading
Loading