This document describes the detection systems for Window Manager (WM) themes and cursor themes/sizes. These systems identify the visual appearance settings of window managers and cursor configurations across different platforms, including Linux and Windows.
For GTK and Qt application theme detection, see GTK and Qt Theme Detection. For WM and DE process detection, see Window Manager and Desktop Environment Detection.
The WM theme and cursor detection subsystems determine:
These systems support multiple window managers (KWin, Mutter, XFWM4, DWM) and desktop environments (Plasma, GNOME, Windows Desktop), each with their own configuration storage mechanisms like the Windows Registry or Linux configuration files.
The detection systems follow a strategy pattern where different WM/DE combinations require different detection methods. The implementation uses a combination of configuration file parsing, settings database access (DConf/GSettings), and direct Registry access on Windows.
On Windows, theme and cursor information is stored primarily in the Windows Registry under HKEY_CURRENT_USER.
Sources:
Sources:
Windows detection relies on the common/windows/registry.h utility functions to query keys.
| Feature | Registry Path | Key/Value | Logic |
|---|---|---|---|
| Theme Name | ...\Themes | CurrentTheme | Path is parsed to extract file name (e.g., "Aero") via ffStrbufSubstrAfterLastC src/detection/wmtheme/wmtheme_windows.c70-78 |
| Accent Color | ...\DWM | AccentColor | Converted from BGR to RGB hex or mapped to string via colorHexToString src/detection/wmtheme/wmtheme_windows.c86-102 |
| Dark/Light Mode | ...\Personalize | SystemUsesLightTheme | Appends "System: Light/Dark" to result using ffRegReadValues src/detection/wmtheme/wmtheme_windows.c107-122 |
| Cursor Theme | Control Panel\Cursors | (Default) | Fetches the active scheme name via FF_ARG(result->theme, NULL) src/detection/cursor/cursor_windows.c13 |
| Cursor Size | Control Panel\Cursors | CursorBaseSize | Returns pixel size as integer via ffStrbufAppendUInt src/detection/cursor/cursor_windows.c14-16 |
Sources:
The detectWMThemeFromConfigFile() function provides a generic mechanism for reading theme names from INI-style configuration files using ffParsePropFileConfig().
KWin Example:
~/.config/kwinrctheme =qml_ and svg__ prefixes src/detection/wmtheme/wmtheme_linux.c31-40For GNOME-based environments, WM themes are stored in DConf/GSettings databases accessed via the ffSettingsGetGnome() abstraction.
| Environment | Schema/Path | Key |
|---|---|---|
| GNOME Shell | org.gnome.shell.extensions.user-theme | name |
| Cinnamon | /org/cinnamon/theme/name | name |
| XFCE | xfwm4::/general/theme | (via XFConf) |
Sources:
While technically distinct from WM themes, terminal font detection often involves similar configuration parsing. For Windows Terminal, detection involves:
settings.json by checking Portable, Store, or Preview paths using FOLDERID_LocalAppData src/detection/terminalfont/terminalfont_windows.c98-145yyjson_read_opts with comment support src/detection/terminalfont/terminalfont_windows.c48-52WT_PROFILE_ID environment variable src/detection/terminalfont/terminalfont_windows.c59-79font.face and font.size using yyjson_obj_get src/detection/terminalfont/terminalfont_windows.c18-35Sources:
Used across platforms to store detected cursor information.
Sources:
Used by the theme module to store part 1 and part 2 of the theme string (often Name and Accent).
Sources:
The ffPrintTheme function in the theme module acts as the high-level orchestrator:
FFThemeResult with ffStrbufCreate() src/modules/theme/theme.c9-12ffDetectTheme() (which dispatches to ffDetectWmTheme or platform-specific logic) src/modules/theme/theme.c13ffStrbufDestroy() src/modules/theme/theme.c42-43Sources:
Refresh this wiki