I have a launcher on my desktop and want to add another one manually with the same icon.

When I go to the preferences of the existing launcher and click the icon, it doesn't take me to the folder where the icon is stored but just to my home folder.

How can I find out where the used icon of the launcher is located in my system?

4 Answers 4


Most of the time, the icon will be chosen from your current icon theme, rather than being referred to as an absolute path.

  1. Open Gedit

  2. Drag the launcher into the Gedit window

  3. Look for the Icon definition:


You can then find the icon somewhere in /usr/share/icons, depending on your theme.

Here's a quick python script that finds the correct icon path for you:

import gtk

print "enter the icon name (case sensitive):"
icon_name = raw_input(">>> ")
icon_theme = gtk.icon_theme_get_default()
icon = icon_theme.lookup_icon(icon_name, 48, 0)
if icon:
    print icon.get_filename()
    print "not found"

Save it somewhere and run python /path/to/script.py.

It'll look like this:

stefano@lenovo:~$ python test.py 
enter the icon name (case sensitive):
>>> gtk-execute

Alternatively, you can just rummage around in /usr/share/icons until you find the icon you're looking for.

Much easier: you can just copy and paste the launcher and change the name and command

EDIT 2018

Updated version of the script above:

#!/usr/bin/env python3
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk

icon_name = input("Icon name (case sensitive): ")
icon_theme = Gtk.IconTheme.get_default()
icon = icon_theme.lookup_icon(icon_name, 48, 0)
if icon:
    print("not found")
  • 6
    Another common path to check is /usr/share/pixmaps.
    – htorque
    Jul 9, 2011 at 14:38
  • @Stefano: Hero! Thank you very much for both of your answers. Works brilliant. At least the 2nd way should have come to my mind too. Jul 9, 2011 at 18:13
  • Traceback (most recent call last): File "LookUget.py", line 2, in <module> import gi ImportError: No module named gi
    – JulianLai
    Jan 19, 2019 at 1:28
  • works for me in Archlinux+Xfce4 . Thanks
    – SAYE
    Apr 11, 2022 at 15:17
  • Works also for NixOS users! The nix-shell line is nix-shell -i python3 -p pkgs.python3 -p pkgs.gtk3 -p pkgs.gobject-introspection -p pkgs.python3Packages.pygobject3
    – Grwlf
    Nov 19, 2022 at 18:36

This is based from Stefano Palazzo's answer here.

#!/usr/bin/env python3

from gi.repository import Gtk

icon_name = input("Icon name (case sensitive): ")
if icon_name:
    theme = Gtk.IconTheme.get_default()
    found_icons = set()
    for res in range(0, 512, 2):
        icon = theme.lookup_icon(icon_name, res, 0)
        if icon:

    if found_icons:
        print(icon_name, "was not found")

Save the above into a file and run it with python3 /path/to/file.

Differences between Stefano Palazzo's original script are that:

  • This find all resolutions of the icon (not just 48)
  • Uses gi.repository instead of Gtk
  • Uses Python 3 instead of 2
  • Slightly tweaked in other ways

A little more info.

Normal launchers are really .desktop files in /usr/share/applications/.

For example: /usr/share/applications/usb-creator-gtk.desktop

(See https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html)

Each desktop file has a line that specifies the icon, for example:


When there is no path (and file extension) (as in this case), it means the icon is found (somewhere) in /usr/share/icons/ and the one used at run-time depends on the current theme and in some cases the display context (size).

Knowing the icon name (without extension) from the desktop file, one can find it/them as follows:

$ find . -name "usb-creator-gtk*"

Had added this as a bonus on a question on unix.stackexchange and realized it would probably be decent to share here in the original thread as well... so

Here is another modified version which combines some of the elements of Stefano Palazzo's 2018 version and kiri's version along with my own changes (some comment doc at top of script).

#!/usr/bin/env python3
# ==========================================================================================
# This script is for looking up an icon file path based on the icon name from a *.desktop file.
# Parts of it are based on snippets provided by Stefano Palazzo and kiri on askubuntu.com
#   https://askubuntu.com/questions/52430/how-can-i-find-the-location-of-an-icon-of-a-launcher-in-use
# ==========================================================================================
# The original version(s) simply prompted the user for the icon name.
# However, I have modified this version in the following ways:
#   1. Added ability to pass specific size as arg (e.g. --size=22 or --size=48, etc)
#   2. Added ability to pass icon names as arg (any other arg besides --size)
#       Note: if --size is used with multiple icon names, then it is assummed
#             that all of the icons in the search will be for the same size
#   3. Like kiri's version, I removed the hard-coded size of 48x48 and default to all sizes
#   4. Unlike kiri's version, you can optionally still search for a specific size (using #1)
#   5. Performance improvements from kiri's version (he was checking every even number from
#       0 to 500 -- so 250 iterations. I base mine off the values that actually existing under
#       /etc/share/icons/hicolor - of which there were 17. So his is more flexible but
#       mine should be quicker and more forgiving in terms of HDD wear and tear)
# ==========================================================================================
import gi
import sys
import array as arr 
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
def resolveIconPath( iconName, iconSize = -1 ):
    "This takes a freedesktop.org icon name and prints the GTK 3.0 resolved file location."
    iconTheme = Gtk.IconTheme.get_default()
    # if looking up a specific size
    if iconSize >= 16:
        msgTemplate = "iconname: \"" + iconName + "\" (size: " + str(iconSize) + "): "
        iconFile = iconTheme.lookup_icon(iconName, iconSize, 0)
        if iconFile:
            print(msgTemplate + iconFile.get_filename() + "\n")
            print("W:" + msgTemplate + " No matching path(s) found.\n")
        # otherwise, look up *all* sizes that can be found
        msgTemplate = sep + "\niconname: \"" + iconName + "\":\n" + sep
        foundIconsList = list()
        for resolution in [16, 20, 22, 24, 28, 32, 36, 48, 64, 72, 96, 128, 192, 256, 480, 512, 1024]:
            iconFile = iconTheme.lookup_icon(iconName, resolution, 0)
            if iconFile:
                if not (filePath in foundIconsList):
        if foundIconsList:
            print(msgTemplate + "\n"+ "\n".join(foundIconsList)+ "\n")
            print("W: iconname: \"" + iconName + "\":  No matching path(s) found.\n")
# get the total number of args passed (excluding first arg which is the script name)
argumentsLen = len(sys.argv) - 1
# define a list for storing all passed icon names
iconNamesList = []
# loop through passed args, if we have any and handle appropriately
if argumentsLen > 0:
    for i in range(1, len(sys.argv)):
        #print(i, "arg: " + arg)
        if arg.startswith('--size=') or arg.startswith('-s=') or arg.startswith('-S='):
            if len(tmpSize) > 0 and tmpSize.isnumeric():
                print("Invalid size '" + tmpSize + "'; Expected --size=xx where xx is a positive integer.")
        elif arg == '--help' or arg == '-h':
            print(str(sys.argv[0]) + " [OPTIONS] [ICON_NAME]\n")
            print("Takes a freedesktop.org/GNOME icon name, as commonly appears in a *.desktop file,")
            print("and performs a lookup to determine matching filesystem path(s). By default, this")
            print("path resolution is determined for all available icon sizes. However, a specific")
            print("size can be used by providing one of the options below.\n")
            print("  -s=n, --size=n   Restricts path resolution to icons matching a specific size.")
            print("                   The value n must be a positive integer correspending to icon size.")
            print("                   When using this option with multiple passed icon names, the size")
            print("                   restrictions are applied to *all* of the resolved icons. Querying")
            print("                   different sizes for different icons is only possible via the use of")
            print("                   multiple calls or by parsing the default output.\n")
            print("  -h, --help       Display this help page and exit.\n")
# if no icon names were passed on command line, then prompt user
if len(iconNamesList) == 0:
    iconNamesList.append(input("Icon name (case sensitive): "))
#print("size: " + str(size))
#print("iconNamesList: ")
if len(iconNamesList) > 0:
    for iconName in iconNamesList:
        if size < 16:
            # find all sizes (on my system, 16x16 was the smallest size icons under hicolor)
            # use custom size
            resolveIconPath(iconName, size)


# view help
get-icon-path.py --help
# lookup all matching icons
get-icon-path.py firefox
# lookup all matching icons for a specific size (16x16)
get-icon-path.py --size=16 firefox
# lookup specific size for multiple icons in one command
get-icon-path.py --size=16 firefox gimp
# install to system for frequent usage
sudo cp get-icon-path.py /usr/bin/get-icon-path.py
sudo chown root:root /usr/bin/get-icon-path.py;
sudo chmod 755 /usr/bin/get-icon-path.py;
test ! -f /usr/bin/icon && ln -s /usr/bin/get-icon-path.py /usr/bin/icon;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.