GNOME Bugzilla – Bug 606873
Hard to find out which file used as icon for launcher
Last modified: 2018-05-09 19:14:18 UTC
I couldn't find as easy way to tell which file is being used as the icon for a file. I think it should be clear to find this out. Perhaps it should be that when the 'change icon' button is pressed in a file's properties window, the file selector would appear with the current file selected. To reproduce, 1. Click on Applications in the menu. 2. Point to Internet. 3. Right click on Firefox Web Browser. 4. Click Add this Launcher to Desktop. 5. Right click on the icon that's been added to the desktop. 6. Click Properties. No where in the properties window is the location of the file used as the image for this launcher (the icon). 7. Click on the button that has nothing but the Firefox icon on it, near the name of the launcher. A file selector dialog window appears and it's location is your home directory. I see now by looking into the source of the .desktop file, that the specification for an icon there is not a path to a file, but some other method of name. It says 'Icon=firefox-3.0'. This is why the file selector dialog window doesn't appear with a file selected, I guess. So there's no easy way to tell which file is being used as the icon for icons which don't have a specific file defined, but have an icon defined by a different method. Downstream report at: https://bugs.launchpad.net/ubuntu/+source/nautilus/+bug/460941
I left a comment at https://bugs.launchpad.net/ubuntu/+source/nautilus/+bug/460941/comments/9. Here it is: I'd like to point out that it is possible to figure out the filename using the icon name (see below for some Python code), so it would be possible to have the file chooser start with this file selected. However, ideally this isn't the route we want to take. Instead the file chooser in this instance should be replaced by a dialog tailored towards the job at hand, findings icons. That's going to require a bit of effort though and the Nautilus team can use any help they can get, so if you're interested in working on this, you'll want to start with writing a specification (rationale, use cases, user interface mockups). Some examples of specifications can be found at https://wiki.ubuntu.com/CategorySpec (template: https://wiki.ubuntu.com/SpecSpec) and https://fedoraproject.org/wiki/Features (for example: https://fedoraproject.org/wiki/Features/UserAccountDialog). An elaborate example of a specification can be found at https://wiki.ubuntu.com/NotifyOSD I'll keep an eye on this report. ---------- Here's some Python code which would allow you to lookup the filename for an icon name: import gtk icontheme = gtk.icon_theme_get_default() iconinfo = icontheme.lookup_icon('totem', size=256, flags=gtk.ICON_LOOKUP_USE_BUILTIN) print iconinfo.get_filename() ... /usr/share/icons/hicolor/scalable/apps/totem.svg Had you gone with size=24 then it would have selected the PNG instead.
This no longer applies to the latest development version. Now, .desktop files are regular configuration files, not launchers anymore.