Expand description
OS detection: dark mode, reduced motion, accessibility preferences, icon theme and set, desktop environment.
Structs§
- Detection
Context - Process-wide detection cache.
Enums§
- Linux
Desktop - Desktop environments recognized on Linux.
Functions§
- accessibility_
preferences - The OS accessibility preferences (cached): what
AccessibilityPreferences::from_systemreads, without running the platform reader again. - detect_
icon_ theme - Detect the icon theme name for the current platform without caching.
- 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(),accessibility_preferences(), orsystem_icon_theme()re-queries the OS; a cached failure to detect the icon theme is cleared too, and so, on Linux, is the detected desktop environment, with the desktop refined from it. The font DPI is not cached: since 0.7.1 it is a constant per platform, whichResolutionContext::from_system()uses. - 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_
icon_ set - Detect the native icon set for the current operating system.
- system_
icon_ theme - Detect the icon theme name for the current platform (cached).
- system_
is_ dark - Detect whether the system is using a dark color scheme.