Skip to main content

Module system

Module system 

Source
Expand description

“Follow system” appearance: detect the OS dark/light setting and map it to a preset.

Constants§

SYSTEM_DARK_INDEX
Preset used while the system is in dark mode (index into THEME_NAMES).
SYSTEM_LIGHT_INDEX
Preset used while the system is in light mode (index into THEME_NAMES).
SYSTEM_THEME_NAME
Persisted theme_name meaning “follow the operating system’s light/dark setting”.

Functions§

current_system_theme_index
Preset index matching the current system appearance (dark if undetectable).
detect_system_dark
Is the OS in dark mode? None when it can’t be determined (callers pick a default).
is_system_name
Whether name is the “follow system” pseudo-theme (case-insensitive).
parse_gsettings
Parse gsettings get org.gnome.desktop.interface color-scheme ('prefer-dark', …).
parse_macos
Parse defaults read -g AppleInterfaceStyle output (macOS): prints Dark in dark mode.
parse_windows
Parse reg query … /v AppsUseLightTheme output (Windows): 0x0 means dark.
system_theme_index
The preset index to show for a given system appearance.