Sunday, May 5, 2024
 Popular · Latest · Hot · Upcoming
22
rated 0 times [  22] [ 0]  / answers: 1 / hits: 46261  / 2 Years ago, sun, september 18, 2022, 5:31:43

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?


More From » launcher

 Answers
5

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:


    Icon=gnome-panel-launcher




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()
else:
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
/usr/share/icons/Humanity/actions/48/gtk-execute.svg

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(icon.get_filename())
else:
print("not found")

[#44281] Monday, September 19, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
hirtieve

Total Points: 207
Total Questions: 104
Total Answers: 114

Location: Cook Islands
Member since Thu, May 21, 2020
4 Years ago
;