Skip to main content

system_icon_theme

Function system_icon_theme 

Source
pub fn system_icon_theme() -> &'static str
Expand description

Detect the icon theme name for the current platform.

Returns the name of the icon theme that provides the actual icon files:

  • macOS / iOS: "sf-symbols" (no user-configurable icon theme)
  • Windows: "segoe-fluent" (no user-configurable icon theme)
  • Linux: DE-specific detection (e.g., "breeze-dark", "Adwaita")
  • Other: "material" (bundled fallback)

On Linux, the detection method depends on the desktop environment:

  • KDE: reads [Icons] Theme from kdeglobals
  • GNOME/Budgie: gsettings get org.gnome.desktop.interface icon-theme
  • Cinnamon: gsettings get org.cinnamon.desktop.interface icon-theme
  • XFCE: xfconf-query -c xsettings -p /Net/IconThemeName
  • MATE: gsettings get org.mate.interface icon-theme
  • LXQt: reads icon_theme from ~/.config/lxqt/lxqt.conf
  • Unknown: tries KDE, then GNOME gsettings, then "hicolor"

ยงExamples

use native_theme::system_icon_theme;

let theme = system_icon_theme();
// On a KDE system with Breeze Dark: "breeze-dark"
// On macOS: "sf-symbols"