Referencing icons in
You can simply put the full path in the file or the path to an icon in the default icon directories (explained below)
Adding multiple resolutions to an icon
You can let your own icons have multiple resolutions by placing them in one of the following folders:
<RESOLUTION> with the resolution of the icon (in
48x48 format), replace
<NAME> with a unique name you would like to reference it with, replace
.png with the extension for the icon (if it has a different one).
For the current user only:
For all users on the system:
To reference this icon in a
.desktop file, you will use only the
<NAME> of it without the extension.
The icon must be of PNG, XPM or SVG format, and have the correct file extension
(.png, .xpm or .svg).
If the icon is a
.svg (Scalable vector graphics) file, you can use
scalable as the
<RESOLUTION> in either path above.
Finding icons without a full path
(Use this to locate the icon for
chromium-browser, for example)
Inspired by Stefano Palazzo♦'s answer here:
from gi.repository import Gtk
icon_name = input("Icon name (case sensitive): ")
theme = Gtk.IconTheme.get_default()
found_icons = set()
for res in range(0, 512, 2):
icon = theme.lookup_icon(icon_name, res, 0)
Save the above into a file and run it with