Module icontheme.lookup

Lookup of icon themes and icons.

Note

All found icons are just paths. They are not verified to be valid images.

See Also

Icon Theme Specification

Functions

NameDescription
findClosestIcon(iconName, desiredSize, iconThemes, searchIconDirs, extensions, allowNonThemed) Find icon of the closest size. It uses icon theme cache wherever possible. The first perfect match is used. This is similar to findClosestThemedIcon, but returns file path only and allows to search for non-themed icons.
findClosestIcon(iconName, size, iconThemes, searchIconDirs) ditto, but with predefined extensions and non-themed icons allowed.
findClosestThemedIcon(iconName, desiredSize, iconThemes, searchIconDirs, extensions) Find icon of the closest size. It uses icon theme cache wherever possible. The first perfect match is used. It searches only for icons in themes.
findClosestThemedIcon(iconName, size, iconThemes, searchIconDirs) ditto, but with predefined extensions.
findIconTheme(themeName, searchIconDirs) Find index.theme file by theme name.
findLargestIcon(iconName, iconThemes, searchIconDirs, extensions, allowNonThemed) Find icon of the largest size. It uses icon theme cache wherever possible. This is similar to findLargestThemedIcon, but returns file path only and allows to search for non-themed icons.
findLargestIcon(iconName, iconThemes, searchIconDirs) ditto, but with predefined extensions and non-themed icons allowed.
findLargestThemedIcon(iconName, iconThemes, searchIconDirs, extensions) Find icon of the largest size. It uses icon theme cache wherever possible.
findLargestThemedIcon(iconName, iconThemes, searchIconDirs) ditto, but with predefined extensions.
findNonThemedIcon(iconName, searchIconDirs, extensions) Find icon outside of icon themes. The first found is returned.
iconSizeDistance(subdir, matchSize) Distance between desired size and minimum or maximum size value supported by icon theme subdirectory.
iconThemePaths(searchIconDirs) Find all icon themes in searchIconDirs.
lookupIcon(iconName, iconThemes, searchIconDirs, extensions, sink, reverse) Lookup icon alternatives in icon themes. It uses icon theme cache wherever it's loaded. If searched icon is found in some icon theme all subsequent themes are ignored.
lookupIconTheme(themeName, searchIconDirs) Lookup index.theme files by theme name.
lookupNonThemedIcon(iconName, searchIconDirs, extensions) Lookup icon alternatives beyond the icon themes. May be used as fallback lookup, if lookupIcon returned empty range.
lookupNonThemedIcons(searchIconDirs, extensions) Iterate over all icons out of icon themes.
lookupThemeIcons(iconThemes, searchIconDirs, extensions) Iterate over all icons in icon themes. iconThemes is usually the range of the main theme and themes it inherits from.
matchBestIcon(alternatives, matchSize) Find icon closest to the given size among given alternatives.
matchIconSize(subdir, matchSize) Check if matchSize belongs to subdir's size range.
openBaseThemes(iconTheme, searchIconDirs, genericThemeName, options) Recursively find all themes the given theme is inherited from.
openIconTheme(themeName, searchIconDirs, options) Find index.theme file for given theme and create instance of IconThemeFile. The first found file will be used.
openThemeFamily(iconTheme, searchIconDirs, genericThemeName, options) Recursively find all themes the given theme is inherited from.
openThemeFamily(iconThemeName, searchIconDirs, genericThemeName, options) ditto, but firstly loads the given icon theme by name. Returns an empty array if theme specified by iconThemeName could not be loaded.

Structs

NameDescription
IconSearchResult Result of icon lookup.

Manifest constants

NameTypeDescription
defaultGenericIconTheme Convenient constant for the default icon theme name.
defaultIconExtensions Default icon extensions. This array includes .png and .xpm. PNG is recommended format. XPM is kept for backward compatibility.

Aliases

NameTypeDescription
defaultFallbackIconTheme defaultGenericIconTheme