Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

When making a custom launcher, it is nice to have a matching icon for it from the default usr ubuntu directories. The problem that is: Ubuntu seems to store icons in about 50 or more folders. Browsing all of them in nautilus takes ages.

So my question is: Is there some kind of icon browser that shows an overview of all icons in /usr/share/icons/*?

share|improve this question
add comment

1 Answer 1

up vote 8 down vote accepted

Instead of opening the folders one by one, you can also use the Search feature of Nautilus. Navigate to /usr/share/icons, and press the Search icon on the right of the toolbar.

Search for . (all images have an extension with a dot before it) and press Enter. On a default installation, this yields about 17.5k images. That's not much of an "overview", but it includes all files in /usr/share/icons.

If you wish to avoid searching each time, you could make use of symbolic links to the images: all images are accessible from one big folder.

  1. Open a terminal
  2. To check the number of files that can be created after creating the links:

    expr $(df /home -i | tail -1 | cut -d'%' -f1 | rev | awk '{ print $2 }' | rev) - $(find /usr/share/icons -type f | wc -l)
    

    You should not continue if the number is lower than 1000 and a negative number will cause the operation to fail after some time.

  3. Make an folder named icons-all by running: mkdir icons-all
  4. Go into that folder: cd icons-all
  5. Run nano /tmp/make-icons-link
  6. Paste:

    #!/bin/bash
    if [[ $1 == *.* ]]; then
            ext=".${1##*.}"
    else
            ext=
    fi
    name="$(basename "$1" "$ext")"
    extra=
    while [ -e "$name$extra$ext" ]; do
        ((extra++))
    done
    ln -s "$1" "$name$extra$ext"
    
  7. Press Ctrl + X, followed by Y and Enter
  8. Now generate the links, this may take a while:

    find /usr/share/icons/ -type f -exec bash /tmp/make-icons-link {} \;
    

    After the command has completed, no output is shown.

  9. Close the terminal by running exit
  10. The images are now visible in ~/icons-all. Loading this directory may take a while
share|improve this answer
    
great, thank you! –  tobi Jun 14 '11 at 15:31
    
I had the same problem I found the solution above very slow - so I used picassa to index - I found this to be effective. –  user52652 Mar 30 '12 at 0:42
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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