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.

I want to make use of all the icons which are installed on my computer to make art, posters and designs, what is the best way of making them all easily browsable from inkscape?

share|improve this question

5 Answers 5

up vote 4 down vote accepted

If you want to make a copy of them all in to one directory try the following:

sudo updatedb
mkdir $HOME/svg
locate *.svg | awk -F'/' '{X=NF-1;Y=NF-2;Z=NF-3}{ system("cp "$0" '$HOME'/svg/"$Z"\"-\""$Y"\"-\""$X"\"-\""$NF) }'

That will copy all SVG files into an svg folder in your home. You can of course adjust those paths as needed. Since a lot of the System SVG's (Icon sets) are the same name among theme. This will copy them into the SVG folder like so:

This /usr/share/icons/Humanity/actions/22/mail-read.svg becomes ~/svg/Humanity-actions-22-mail-read.svg meaning you can view them in one Nautilus folder without having to traverse often cumbersome directory structures.

Another alternative - to keep all your SVGs in the same location, but have them update when theme icon-sets get updated - would be to symlink them all to that folder. As long as you performed a "Save-As" instead of overwriting icons when working on them:

sudo updatedb
mkdir $HOME/svg
locate *.svg | awk -F'/' '{X=NF-1;Y=NF-2;Z=NF-3}{ system("ln -s "$0" '$HOME'/svg/"$Z"\"-\""$Y"\"-\""$X"\"-\""$NF) }'
share|improve this answer
    
I think symbolic or hard links would work fine, no need to copy them. –  Martin Owens -doctormo- Nov 17 '10 at 5:39
    
@Martin I agree - though some people may wish to edit the icons - but not the source so that option is there. You have both solutions listed though :) –  Marco Ceppi Nov 17 '10 at 5:45

In nautilus:

  1. Go to /usr/
  2. Click the search button and type .svg
  3. Go to the bookmarks window and click "Add Bookmark"

The virtual search folder will update automatically. It wont be fast... But it should work.

share|improve this answer
    
I'd like something fast, can anything be done with the locate db? –  Martin Owens -doctormo- Nov 17 '10 at 2:03

You can use locate and it will be fast but will only contain the files since the last updatedb was executed (usually executed from /etc/cron.daily/mlocate)

locate -i *.svg

the -i option make the pattern case insensitive.

share|improve this answer
    
-i is not necessary in this case because the svgs are almost definitely lowercase file extensions, but good addition none the less. –  RolandiXor Nov 17 '10 at 3:37
    
That's just the programmer in me who's used to working with non-normalized data... people tend to input the strangest things that'll break an application. –  SiliconChaos Nov 17 '10 at 3:39

I've found locate to be the fastest/most useful tool for things like this. Try running locate *.svg > ~/svgs.txt in a terminal or from Alt+F2.

To access them from inkscape, you could possibly do a little scripting (I'm no bash genius :P), so that you produce symlinks to a new folder with all the existing svgs (from the output of locate). Maybe if you can make a script that reads the contents of each line and does ln -s $line ~/Art/svgs or something.

share|improve this answer
sudo find / -name *.svg 

This will list all files with .svg extension

To get the output to a file:

sudo find / -name *.svg > output.txt

UPDATE: To copy all .svg files in to a specific folder

find ./ -name "*.svg" -exec cp '{}' ./mnt/output_folder/ ';'

This will copy all .svg files to /mnt/output_folder

share|improve this answer
    
That won't provide access to these files in inkscape. –  Martin Owens -doctormo- Nov 17 '10 at 5:36
    
What about when there are SVG's with the same name? IE: /usr/share/icons/Tango/scalable/actions/stop.svg and /usr/share/icons/gnome/scalable/actions/stop.svg? –  Marco Ceppi Nov 17 '10 at 7:06

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.