I will try to be as detailed as possible on what I am trying to do. Essentially I have a program I have compiled, but I need to take all the SVG's that are in different directories and resize them all the the same size because right now they are all sized differently. Then I want to replace the originals in the exact same location with the converted ones. The program I am using for resizing is rsvg-convert which won't let me over write the originals so I have to save them in a different location. What I am attempting to do is convert all the files to the same directory structure in a different location then delete the originals and copy everything back so that the file and directory structure is exactly the same. Here is what I have so far, I am getting errors during the conversion line. Also if you think there is a better way to do this please feel free to suggest something different.
for dir in devices dialog effects emblems empty general logo options params tray zones ; do
mkdir -p /tmp/$dir
for i in usr/share/polychromatic/img/$dir/*.svg ; do
rsvg-convert -a -w 24 -h 24 $i > /tmp/$dir/$i
rm -r usr/share/polychromatic/img/$dir/
mv /tmp/$dir/ usr/share/polychromatic/img/
done
done
I am on the right track, but I think my for loop for the *.svg files is wrong because it looks like its going to create the entire path and not just the individual files I need. I am going to keep working on this but any help is appreciated.
Thanks