Merry Christ mas!

Dale Visser dale.visser at gmail.com
Tue Dec 24 23:28:19 UTC 2013


  Great job, Israel! While I hadn't mentioned it, I've hit this issue, too.
It's good to know there's now a way to address it. If you have a blog, this
would be great to share there as well, for anybody using LXDE, and not
using the upcoming 14.04, which I bet will include some version of your
script.

Best regards,
Dale Visser

The plural of 'anecdote' is not 'data'.
 ------------------------------
From: Israel <israeldahl at gmail.com>
Sent: ‎12/‎24/‎2013 4:22 PM
To: lubuntu user list <lubuntu-users at lists.ubuntu.com>
Subject: Merry Christ mas!

  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.
backup=/usr/share/pixmaps/backup/
extraBackup=/usr/share/pixmaps/extraBackup/

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


#!/bin/bash
shopt -s nullglob
iconDir=/usr/share/pixmaps/
backup=/usr/share/pixmaps/backup/
extraBackup=/usr/share/pixmaps/extraBackup/
cd "$iconDir"
putfiles=(*.xpm)
size=24x24
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"
done
fi
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"
done
fi

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"
done

echo "Done!"

-- 
Regards
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/lubuntu-users/attachments/20131224/897ff3cb/attachment.html>


More information about the Lubuntu-users mailing list