Icon Themes

XDG Icon Theme specification

xdg.IconTheme.getIconPath(iconname, size=None, theme=None, extensions=['png', 'svg', 'xpm'])[source]

Get the path to a specified icon.

size :
Icon size in pixels. Defaults to xdg.Config.icon_size.
theme :
Icon theme name. Defaults to xdg.Config.icon_theme. If the icon isn’t found in the specified theme, it will be looked up in the basic ‘hicolor’ theme.
extensions :
List of preferred file extensions.

Example:

>>> getIconPath("inkscape", 32)
'/usr/share/icons/hicolor/32x32/apps/inkscape.png'
xdg.IconTheme.getIconData(path)[source]

Retrieve the data from the .icon file corresponding to the given file. If there is no .icon file, it returns None.

Example:

getIconData("/usr/share/icons/Tango/scalable/places/folder.svg")
class xdg.IconTheme.IconData[source]

Class to parse and validate IconData Files

getAttachPoints()[source]

Retrieve the anchor points for overlays & emblems from the icon data, as a list of co-ordinate pairs, if they are specified.

getDisplayName()[source]

Retrieve the display name from the icon data, if one is specified.

getEmbeddedTextRectangle()[source]

Retrieve the embedded text rectangle from the icon data as a list of numbers (x0, y0, x1, y1), if it is specified.