Skip to main content

Module detect

Module detect 

Source
Expand description

OS detection: dark mode, reduced motion, DPI, desktop environment. OS detection: dark mode, reduced motion, DPI, desktop environment.

Structs§

DetectionContext
Process-wide detection cache.

Enums§

LinuxDesktop
Desktop environments recognized on Linux.

Functions§

detect_is_dark
Detect whether the system is using a dark color scheme without caching.
detect_linux_desktop
Detect the current Linux desktop environment.
detect_reduced_motion
Detect whether the user prefers reduced motion without caching.
invalidate_caches
Reset all process-wide caches so the next call to system_is_dark(), prefers_reduced_motion(), or system_icon_theme() re-queries the OS; a cached failure to detect the icon theme is cleared too.
parse_linux_desktop
Parse XDG_CURRENT_DESKTOP (a colon-separated list) and return the recognized desktop environment.
prefers_reduced_motion
Query whether the user prefers reduced motion.
system
Return the process-wide default DetectionContext.
system_is_dark
Detect whether the system is using a dark color scheme.