View list of all available unique icons with their names and thumbnail

gtk3-icon-browser is a graphical application to list themed icons.

To this date, it is still under development and available for 15.04 (vivid) and newer releases. Its development can be traced back to this blog post dated 2014.

gtk3-icon-browser with normal and symbolic views

Screenshot 1: gtk3-icon-browser (3.24.18) in Adwaita theme viewing Tango icon theme, with normal (left) and symbolic views

gtk3-icon-browser with different icon themes

Screenshot 2: gtk3-icon-browser (3.24.18) with search input "save" and a pop-up window showing icon details, viewing Tango icon theme (left) and elementary Xfce icon theme

Quick review based on above screenshots:

  • Nicely formatted list of all unique icons: Yes ^1
  • Contains the icon name: Yes ^2
  • Preview thumbnail: Yes
  • Location of icons: No ^3
  • Icon theme origin: Yes ^4

Reference notes:

^1: This tool will show as icon view by default (no way to change into list view). Either single-click or double-click on each icon will show all available resolutions for that icon.

^2: The newer version of icon browser (since 3.22.30 or so) has added a button "Copy to Clipboard" to the pop-up window, which allows to copy the icon name with a single click.

^3: This tool most likely looks into /usr/share/icons directory (without mentioning locations for each icons) and pulls additional information according to the icon naming specification.

^4: This tool only shows the icons for current theme. To show icons for other theme, change appearance of the desktop environment from current theme to another theme.

The icon browser requires GTK+ 3.13.4 or newer. Install the relevant package gtk-3-examples in 15.04 (vivid) or newer releases.

sudo apt-get install gtk-3-examples
gtk3-icon-browser

First tested in 15.04 (vivid), and latest in 20.04 (focal).

Related sources:

  1. Source code of gtk/demos at master for GNOME/gtk on GitHub.

  2. New icon browser tool for GTK+ developers in development on Fedora Magazine

  3. Mentioned briefly with screenshot in this answer on Ask Ubuntu.


Well, some DEs show this when you try to change the icon of something, but it is quite easy to do it yourself. Just find all icons, make links to them in some directory and browse the directory. The icons of different resolutions will have the same name, what changes is the path. For example:

$ find /usr/share/icons/ -name '*emacs.*' 
/usr/share/icons/hicolor/16x16/apps/emacs.png
/usr/share/icons/hicolor/48x48/apps/emacs.png
/usr/share/icons/hicolor/scalable/apps/emacs.svg
/usr/share/icons/hicolor/128x128/apps/emacs.png
/usr/share/icons/hicolor/32x32/apps/emacs.png
/usr/share/icons/hicolor/24x24/apps/emacs.png
/usr/share/icons/Mint-X/apps/96/emacs.svg
/usr/share/icons/Mint-X/apps/16/emacs.png
/usr/share/icons/Mint-X/apps/24/emacs.png
/usr/share/icons/Mint-X/apps/48/emacs.png
/usr/share/icons/Mint-X/apps/32/emacs.png
/usr/share/icons/Mint-X/apps/22/emacs.png

As you can see above, the general format is /ParentDir/ThemeName/CLass/Resolution/IconName. So, since the icon's name is the same, we can avoid duplicates easily by having each link created overwrite any existing links of the same name. However, we do want to jeep the icons from the different themes separate, so that requires a little bit more scripting:

#!/usr/bin/env bash

## Create the target directory
mkdir -p ~/foo
## Iterate over all files/dirs in the target locations
for i in ~/.icons/* /usr/share/icons/* /usr/share/pixmaps/*; do 
    ## find all icon files in this directory. If the current $i
    ## is not a directory, find will just print its path directly.
    find "$i" -name '*xpm' -o -name '*.svg' -o -name '*png' | 
        ## Iterate over find's results
        while read ico; do 
            ## Make the link. ${var##*/} will print the
            ## basename of $var, without the path. Here, I use
            ## it both to get the theme name (${i##*/}) and the
            ## icon's name (${ico##*/}).         
            ln -sf "$ico" "${i##*/}"_"${ico##*/}"
        done
done

The script above will create the directory ~/foo which will contain links to each of your unique icon files. The -f option to ln tells it to overwrite existing files with the same name and, since we're using the theme name in the link's name, there should be no duplicates. For example, given the emacs.png icons shown above, it will create:

hicolor_emacs.png -> /usr/share/icons/hicolor/48x48/apps/emacs.png
Mint-X_emacs.png -> /usr/share/icons/Mint-X/apps/22/emacs.png

You can now, browse to ~/foo and have a look:

enter image description here

Then, to get the source packages, you could run:

for i in ~/foo/*; do dpkg -S $(readlink -f "$i"); done

Tags:

Icons