Icons
Overview
Section titled “Overview”Raffi supports icons from system icon themes. Icons are automatically discovered from standard XDG directories and cached for performance.
Icon Specification
Section titled “Icon Specification”Specify icons by their theme name:
launchers: firefox: binary: firefox description: "Firefox" icon: firefoxRaffi searches for icons in system icon directories and uses the icon name to look up the full path.
Icon Discovery
Section titled “Icon Discovery”Raffi discovers icons from standard XDG directories:
$XDG_DATA_HOME/icons(defaults to~/.local/share/icons)$XDG_DATA_DIRS/icons(defaults to/usr/local/share/icons:/usr/share/icons)$XDG_DATA_HOME/pixmaps$XDG_DATA_DIRS/pixmaps
Supported Formats
Section titled “Supported Formats”Raffi supports:
- PNG images (
.png) - SVG images (
.svg)
Icon Size Preference
Section titled “Icon Size Preference”Raffi renders icons at 48×48 pixels and prefers larger source icons for better quality:
- Scalable icons (from
scalable/directories) are prioritized - 48×48 or larger icons are preferred over smaller sizes
- If multiple sizes exist, the largest icon is selected
For example, given these icon paths:
/usr/share/icons/Papirus/16x16/apps/firefox.png/usr/share/icons/Papirus/48x48/apps/firefox.png/usr/share/icons/Papirus/scalable/apps/firefox.svgRaffi selects the scalable SVG for best quality.
Icon Caching
Section titled “Icon Caching”Icon paths are cached to improve startup performance.
Cache Location
Section titled “Cache Location”$XDG_CACHE_HOME/raffi/icon.cacheDefaults to ~/.cache/raffi/icon.cache if XDG_CACHE_HOME is not set.
Cache Format
Section titled “Cache Format”The cache is a JSON file mapping icon names to absolute paths:
{ "firefox": "/usr/share/icons/Papirus/scalable/apps/firefox.svg", "terminal": "/usr/share/icons/Papirus/48x48/apps/terminal.png", "chromium": "/usr/share/icons/hicolor/scalable/apps/chromium.svg"}Refreshing the Cache
Section titled “Refreshing the Cache”The cache is automatically generated on first run. To regenerate it:
raffi --refresh-cacheOr use the short flag:
raffi -rDisabling Icons
Section titled “Disabling Icons”Icons can be disabled for faster startup:
Via Command Line
Section titled “Via Command Line”raffi --no-iconsOr:
raffi -IVia Configuration
Section titled “Via Configuration”general: no_icons: trueExamples
Section titled “Examples”Icon Name Examples
Section titled “Icon Name Examples”# System icon by namelaunchers: firefox: binary: firefox description: "Firefox" icon: firefox
# No icon specified terminal: binary: kitty description: "Terminal"Real-World Examples
Section titled “Real-World Examples”From the example configuration:
launchers: wally: binary: jumpapp args: ["-X", "wally"] description: "Wally" icon: wally ifexist: wally
evolution-mail: binary: jumpapp args: ["-t", "Evolution", "-X", "evolution"] description: "Evolution Mail" icon: evolution-mail ifexist: evolution
signal: binary: jumpapp args: ["-X", "signal", "signal-desktop"] description: "Signal" icon: signal-desktop ifexist: signal-desktop
golang: binary: jumpapp args: ["-c", "jetbrains-goland", "goland"] description: "Goland" icon: golandTroubleshooting
Section titled “Troubleshooting”Icon Not Found
Section titled “Icon Not Found”If an icon isn’t displaying:
-
Check icon name: Verify the icon exists in your theme:
Terminal window find /usr/share/icons -name "firefox.*" -
Refresh cache: Icon cache may be outdated:
Terminal window raffi --refresh-cache -
Add to XDG directories: Place your icon in a standard XDG icon directory so it can be found by name.
Custom Icon Directories
Section titled “Custom Icon Directories”To use icons from custom directories, add them to XDG environment variables:
export XDG_DATA_DIRS="$HOME/.local/share:/usr/local/share:/usr/share"Then refresh the cache:
raffi --refresh-cache