xdgicons

xdgicons
Login

xdgicons

The xdgicon command


Synopsis

package require xdgicons
package require sqlite3
xdgicon subcommand ?arg ...?


Description

The xdgicon command is used to locate icon files according to the XDG Icon Theme Specification. The legal values of subcommand are listed below. Note that you can abbreviate the subcommands.

xdgicon basedirs ?list?
Configure the set of base directories that will be searched for icons. If list is not supplied, the current set of directories is returned. The set is initialized to the directories specified by the XDG Icon Theme Specification: $HOME/.icons, $XDG_DATA_DIRS/icons (including $XDG_DATA_HOME/icons), and /usr/share/pixmaps.

xdgicon cache ?dbname?

Configure the location of a cache file that is used to speed up icon searches. If dbname is an empty string then a temporary cache file is created that is automatically deleted when the application terminates. If dbname is not supplied, the current cache file name is returned. The default cache file is $HOME/.cache/tcltk/xdgicons.db.

xdgicon find size name ?name ...?

Find an icon of the specified size matching any of the listed names. The file representing the closest match is returned. Additional information about the match is provided in the return options. The following return options are provided when a regular match is found: -type, -size, -minsize, -maxsize, -distance, -threshold, -scale, and -context. When a fallback icon is returned, only the -type option is present, with a value of Fallback.

xdgicon imageformats ?list?

Configure which image formats to include in future searches. The list may include svg, png, and xpm. If the list does not include svg, directories of type Scalable will not be searched. If the list only contains svg, searches will be limited to directories with type Scalable. If list is not supplied, the current set of image formats is returned. Initially, all allowed image formats are selected.

xdgicon scale ?value?

Configure a scaling factor for the display. On high dpi screens, icons may need to be bigger than on a regular screen. Setting this value allows the application to request the same size icons for all types of screens, while getting the appropriate size for high dpi screens. For example, setting the scaling factor to 2 will result in a search for a 48x48 icon when a size 24 is requested. When used with Tk, this value can be set to [tk scaling] * 72 / 96. If value is not supplied, the current scaling factor is returned. The default scaling factor is 1.

xdgicon themes ?list?

Configure which icon themes to search for icons. If the icon themes have parent themes, those will be searched when none of the requested icons can be found in the specified themes. If the requested icons also cannot be found in any of the parent themes, the search continues in the hicolor theme. If list is not supplied, the current list of themes is returned. The list is initialized to the default theme configured by user. If this cannot be determined, the list is initially empty. This means that only the hicolor theme will be searched.