Blog Forum Wiki Links Contact Us NetbookUser
RunCore Pro IV SSD Transforms your ASUS EEE PC by increasing 
performance 5-40X. Your satistfaction guaranteed RunCore Pro 70mm SATA Mini PCI-e SSD
RunCore Pro IV 70mm SATA II Mini PCI-e SSD
RunCore Pro IV 2.5 Inch SATA II SSD

You are not logged in.

#1 2008-03-24 4:56:32 am

SteveLawUK
ExtrEmE User
From: UK
Registered: 2008-03-11
Posts: 3637

Icon Resizing Script

This is a response to the problem of icons overlapping the text labels in Easy Mode -since one of the updates or if you have a European model with the larger icon sizes.

Current version 1.3

From http://forum.eeeuser.com/viewtopic.php?id=21124 in order to better keep track of latest changes to script.

Thanks to Jefficus for original script, and solenostomus and Niel1952 for suggestions and improvements.

The script is below.  It has been tested on only a few machines so far so please backup your /opt/xandros/share/AsusLauncher folder first!  (It should work as intended but it might not look good on some icons, depending on size and position etc)

Alternatively, make a new temporary folder, change ICONDIR to point to that folder and copy in accessibility_icon_background.png, business_icon_background.png, home_icon_background.png & student_icon_background.png then if you put any name_norm.png in this folder and run the script it will only convert those icons.

The more testers though, the better.  Thanks.

Code:

#! /bin/bash

##########################################################################
#  By SteveLawUK based on a script by Jeff Smith <jeff.smith@usask.ca>   #
#  The script will search through every *_norm.png 120x120 icon in the   #
#  AsusLauncher folder (can be changed) and resize to 130x130 producing  #
#  the highlight icons to go with them.                                  #
#                                                                        #
#  Version 1.3 BETA                                                      #
#                                                                        #
#  Thanks to solenostomus and Niel1952 for help and feedback             #
##########################################################################

# This is the folder containing the background and _norm icons - change if you want to keep your AsusLauncher folder safe
ICONDIR="/opt/xandros/share/AsusLauncher"

ENDNAME="_hi.png"

cd $ICONDIR

accessibility_icon="accessibility_icon_background.png"
business_icon="business_icon_background.png"
home_icon="home_icon_background.png"
student_icon="student_icon_background.png"

# Check for existence of background icons
if [ ! -e "$accessibility_icon" -o ! -e "$business_icon"  -o ! -e "$home_icon" -o ! -e "$student_icon" -o ! -e "$home_icon" ]; then
    echo "Cannot find the background icons"
    echo "Please save the files in $ICONDIR"
    exit 1
fi

# Check size of background icons and resize if necessary
if [ `identify -format '%wx%h' $accessibility_icon` = "120x120" ]; then
    convert $accessibility_icon -resize 130x130 $accessibility_icon
    echo "Resized $accessibility_icon"
fi
if [ `identify -format '%wx%h' $business_icon` = "120x120" ]; then
    convert $business_icon -resize 130x130 $business_icon
    echo "Resized $business_icon"
fi
if [ `identify -format '%wx%h' $home_icon` = "120x120" ]; then
    convert $home_icon -resize 130x130 $home_icon
    echo "Resized $home_icon"
fi
if [ `identify -format '%wx%h' $student_icon` = "120x120" ]; then
    convert $student_icon -resize 130x130 $student_icon
    echo "Resized $student_icon"
fi

# Get all files that end with "_norm.png"
for i in *_norm.png
do
    FILENAME=$i 
    
    # Only apply it images that are 120x120 in size
    if [ `identify -format '%wx%h' $FILENAME` = "120x120" ]; then

        # Copy a backup of the old icon first
            cp -p $FILENAME ${FILENAME}_backup
            echo "Converting $FILENAME"

        NEWNAME=${FILENAME/_norm.png/}$ENDNAME
    
        # Make the new base (norm) icon 130x130 and shift it up from the centre (to clear the text)
            convert $FILENAME -repage 130x130+5-10 -background none -flatten $FILENAME

        # Now make all the new highlight icons from the new base icon
            convert $accessibility_icon -draw "image over 0,0,130,130 $FILENAME" accessibility_$NEWNAME
            convert $business_icon -draw "image over 0,0,130,130 $FILENAME" business_$NEWNAME
            convert $home_icon -draw "image over 0,0,130,130 $FILENAME" home_$NEWNAME
            convert $student_icon -draw "image over 0,0,130,130 $FILENAME" student_$NEWNAME
            convert $home_icon -draw "image over 0,0,130,130 $FILENAME" $NEWNAME
    fi

done

Last edited by SteveLawUK (2008-03-24 5:02:18 am)


2G Surf - "A cracking little machine."

If it ain't broke, don't fix it.

Offline

 

#2 2008-03-24 5:48:38 am

Niel1952
Moderator
From: Cambridge, UK
Registered: 2007-11-02
Posts: 4802

Re: Icon Resizing Script

To run SteveLawUK's script:

NB: You must have ImageMagick Installed!

1. Make a backup copy of the AsusLauncher folder.

2. Open terminal (Ctrl+Alt+t).

3. Open a text editor by typing the following code in terminal:

Code:

sudo kwrite /home/user/iconconvert.sh

Press [ENTER].

4. Block and copy the code (excluding "Code:") from SteveLawUK's post into the text editor. Save /home/user/iconconvert.sh and exit the text editor.

5. Make the file executable by typing in terminal:

Code:

sudo chmod a+x /home/user/iconconvert.sh

Press [ENTER].

6. Run /home/user/iconconvert.sh by typing in terminal:

Code:

sudo /home/user/iconconvert.sh

Press [ENTER].

7. Reboot your machine or restart the GUI.

Last edited by Niel1952 (2008-03-24 8:55:03 am)


[Tweaking for] Absolute Beginners - A Guide to tweaking the Eee PC with wizards.
eeeuser Google Custom Search - THE eeeuser.com Search Tool

Offline

 

#3 2008-03-24 8:19:52 am

roysland
New member
Registered: 2008-03-22
Posts: 6

Re: Icon Resizing Script

Got any screenshots before I try it?

Offline

 

#4 2008-03-24 8:25:28 am

Niel1952
Moderator
From: Cambridge, UK
Registered: 2007-11-02
Posts: 4802

Re: Icon Resizing Script

What do you want a screenshot of? It moves any icons which are 120x120 fractionally up and resizes them to 130x130 so that the text is below the icon.


[Tweaking for] Absolute Beginners - A Guide to tweaking the Eee PC with wizards.
eeeuser Google Custom Search - THE eeeuser.com Search Tool

Offline

 

#5 2008-03-24 9:27:12 am

SteveLawUK
ExtrEmE User
From: UK
Registered: 2008-03-11
Posts: 3637

Re: Icon Resizing Script

If you have this problem (look at the Firefox icon)

http://i249.photobucket.com/albums/gg230/SteveLawUK_icons/snapshot1.png

Then the script should change it to this

http://i249.photobucket.com/albums/gg230/SteveLawUK_icons/snapshot2.png

(Or something like, I set that up just for you!)

Last edited by SteveLawUK (2008-03-24 9:37:42 am)


2G Surf - "A cracking little machine."

If it ain't broke, don't fix it.

Offline

 

#6 2008-03-24 2:42:05 pm

roysland
New member
Registered: 2008-03-22
Posts: 6

Re: Icon Resizing Script

Niel1952 wrote:

What do you want a screenshot of? It moves any icons which are 120x120 fractionally up and resizes them to 130x130 so that the text is below the icon.

Ah, I see. I thought you were scaling them down. You know, to sizes like 48x48. Great work though smile Pictures say more than words obviously.

Offline

 

#7 2008-03-24 3:02:54 pm

Niel1952
Moderator
From: Cambridge, UK
Registered: 2007-11-02
Posts: 4802

Re: Icon Resizing Script

It should be quite easy to adapt the script to scale the icons down but you may be constrained by the size and placement of the text.


[Tweaking for] Absolute Beginners - A Guide to tweaking the Eee PC with wizards.
eeeuser Google Custom Search - THE eeeuser.com Search Tool

Offline

 

#8 2008-03-24 3:03:56 pm

SteveLawUK
ExtrEmE User
From: UK
Registered: 2008-03-11
Posts: 3637

Re: Icon Resizing Script

You could scale them down if you want, just play around with the numbers.


2G Surf - "A cracking little machine."

If it ain't broke, don't fix it.

Offline

 

#9 2008-04-05 5:57:31 pm

solenostomus
Senior Member
Registered: 2008-02-23
Posts: 101

Re: Icon Resizing Script

I updated the wiki http://wiki.eeeuser.com/howto:customizeeasymodeicons
and added a new section
"The Semi-automated Way (by script)"

It includes a modified version of the script first posted here by SteveLawUK.

My new version switched tactics - I no longer loop over all icons in the system folder, but all work is done in a working folder.

Recenty when I wanted to install a new icon I found myself in the position that I had one file and needed to created all of the others from it.
The new script (uploaded to the wiki) takes one file as an argument and does the rest.
At the end the user can choose to have the files installed in the system AsusLauncher folder.

Please check the wiki and correct it if I made a mistake. I am new to Wikis and can only hope I did everything right. Correct me if I'm wrong ;-}

Cheers

Offline

 

#10 2008-05-06 10:21:52 am

doucettom
Member
Registered: 2008-01-27
Posts: 20

Re: Icon Resizing Script

Can we put this script right a the end of Jeff's script so all is automated ?

Offline

 

#11 2008-05-06 10:43:57 am

solenostomus
Senior Member
Registered: 2008-02-23
Posts: 101

Re: Icon Resizing Script

doucettom wrote:

Can we put this script right a the end of Jeff's script so all is automated ?

The original purpose of the script was to update all icons 120x120 to 130x130 to take account of the ASUS update.
After that I found no further use for the automated version which trawls over an entire directory. These days I need a script which takes a downloaded GIF/JPG/PNG and creates a set of ASUSLauncher icons from it. That's what my script (in the wiki) is for.

Offline

 

Board footer

Powered by PunBB 1.2.15
© Copyright 2002–2005 Rickard Andersson