Merry Christ mas!

Israel israeldahl at
Tue Dec 24 21:21:51 UTC 2013

Hey everyone, I have made a little script to convert the icons to a
specific size.
It also makes a backup of your current xpm files.
I am no  Bash programmer, but it works.... so I would suggest someone
who is knowledgeable about it look at my file and see if there is some
better programming that can be done to make this nicer, and if any of
the devs are around (after the holidays of course) I'd like to know if
this can be adapted to be used in the menu updating script.
You can tweak this to make different sizes...
This is something that requires SUDO.
Please make sure you are comfortable running potentially dangerous
commands before testing this out.  I have tested it on my computer, and
it works for me.  I'll attach the file, and put it into the e-mail so it
is available to look at before you download it or run it.  If anything
about it needs to be explained I'd be glad to explain what I did, though
if you are good a shell scripting, I am sure you can think of a better
way of doing this.

the things you can edit are
size=24x24  make this whatever size you like... I find 24x24 is good for
the menu...

I have 2 backup directories....  if you try it once backup is created. 
if backup exists extraBackup is created.
If you keep trying it you will get an error that extraBackup already exists.

You will not be prompted for anything except your password at the beginning.
Here it is:

shopt -s nullglob
cd "$iconDir"
echo "This will require a password to backup and convert your icons"
if [ ! -d "$backup" ]; then
echo "Making a backup of $iconDir"
sudo mkdir ${backup}
for file in "${putfiles[@]}"; do
   sudo cp ${file} ${backup}
   echo "$file has been saved to $backup"
if [ -d "$backup" ]; then
echo "You have already backed up your files once...  I'll make another
directory called $extraBackup"
sudo mkdir ${extraBackup}
for file in "${putfiles[@]}"; do
   sudo cp ${file} ${extraBackup}
   echo "$file has been saved to $extraBackup"

echo "This will convert the xpm files to $size"
for file in "${putfiles[@]}"; do
  echo "Processing $file"
  sudo convert ${file} -scale $size ${iconDir}${file}
  echo "Saved to $iconDir $file"

echo "Done!"


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>
-------------- next part --------------
A non-text attachment was scrubbed...
Type: application/x-shellscript
Size: 933 bytes
Desc: not available
URL: <>

More information about the Lubuntu-users mailing list