You are not logged in.

#1 2009-07-02 22:53:04

rebugger
Member
From: Germany
Registered: 2007-10-28
Posts: 229

wicd - easy icon theme creation

What is it?
It's a small bash script for easy creation of new wicd icon themes, because IMHO the original wicd icons are kinda ugly...
All it does, is the whole "give it the right name"-thing.

What is wicd?
Wicd is a nice networkmanager for wired and wireless connections
http://www.archlinux.org/packages/extra/i686/wicd/
http://wicd.sourceforge.net/

Instructions
* Create new folder
* Save the script right there
* Copy the files you want to use to the same directory (read on for a link with samples)
* Edit the DIR variable of the script and run it.

Changes?

* version 01
    Initial upload, nothing special so far
* version 02
    replaced $CP, $MKDIR, $ECHO with cp, mkdir, echo

wicd_iconset.sh

#!/bin/sh

#
# easy creation of wicd iconthemes
# version 02
#
# what it does:
#   creates DIR
#   copies files to DIR (WARNING: existing files in DIR will be overwritten)
#   provides instructions how to use the new theme
#

DIR="./new/"

########################################################################

echo "Checking required files"

FILES=(no-signal.png signal-25.png signal-50.png signal-75.png signal-100.png wired.png wicd-client.png wired-gui.svg)
FOUND=1
for f in ${FILES[@]}
do
    if [ -r $f ]; then
        echo "  [found] $f"
    else
        echo "  [missing] $f"
        FOUND=0
    fi
done

if [ $FOUND == 1 ]; then

    echo "Everything looks fine"
    echo ""
    read -sp "Press ENTER to continue"

    echo ""
    echo ""
    echo "Creating directory $DIR"
    mkdir -p $DIR

    echo "Copying files"
    
    echo -n "  no-signal.png "
    PNG_SIGNAL_NO=(both-no-signal.png idle-no-signal.png receiving-no-signal.png transmitting-no-signal.png)
    for png_no in ${PNG_SIGNAL_NO[@]}
    do
        cp no-signal.png ${DIR}$png_no
        echo -n "."
    done
    echo " finished"

    echo -n "  signal-25.png "
    PNG_SIGNAL_25=(signal-25.png bad-signal-lock.png bad-signal.png both-bad-signal-lock.png both-bad-signal.png idle-bad-signal-lock.png idle-bad-signal.png receiving-bad-signal-lock.png receiving-bad-signal.png transmitting-bad-signal-lock.png transmitting-bad-signal.png)
    for png_bad in ${PNG_SIGNAL_25[@]}
    do
        cp signal-25.png ${DIR}$png_bad
        echo -n "."
    done
    echo " finished"

    echo -n "  signal-50.png "
    PNG_SIGNAL_50=(signal-50.png low-signal-lock.png low-signal.png both-low-signal-lock.png both-low-signal.png idle-low-signal-lock.png idle-low-signal.png receiving-low-signal-lock.png receiving-low-signal.png transmitting-low-signal-lock.png transmitting-low-signal.png)
    for png_low in ${PNG_SIGNAL_50[@]}
    do
        cp signal-50.png ${DIR}$png_low
        echo -n "."
    done
    echo " finished"

    echo -n "  signal-75.png "
    PNG_SIGNAL_75=(signal-75.png good-signal-lock.png good-signal.png both-good-signal-lock.png both-good-signal.png idle-good-signal-lock.png idle-good-signal.png receiving-good-signal-lock.png receiving-good-signal.png transmitting-good-signal-lock.png transmitting-good-signal.png)
    for png_good in ${PNG_SIGNAL_75[@]}
    do
        cp signal-75.png ${DIR}$png_good
        echo -n "."
    done
    echo " finished"

    echo -n "  signal-100.png "
    PNG_SIGNAL_100=(signal-100.png high-signal-lock.png high-signal.png both-high-signal-lock.png both-high-signal.png idle-high-signal-lock.png idle-high-signal.png receiving-high-signal-lock.png receiving-high-signal.png transmitting-high-signal-lock.png transmitting-high-signal.png)
    for png_high in ${PNG_SIGNAL_100[@]}
    do
        cp signal-100.png ${DIR}$png_high
        echo -n "."
    done
    echo " finished"

    echo -n "  wired.png "
    cp wired.png ${DIR}wired.png
    echo ". finished"

    echo -n "  wicd-client.png "
    cp wicd-client.png ${DIR}wicd-client.png
    echo ". finished"
    
    echo -n "  wired-gui.svg "
    cp wired-gui.svg ${DIR}wired-gui.svg
    echo ". finished"

    echo ""
    echo "How to use the new theme?"
    echo "  * Backup the old theme"
    echo "      cp -r /usr/share/pixmaps/wicd /usr/share/pixmaps/wicd_old"
    echo "  * Change owner of the new theme"
    echo "      chown root:root ./new/*"
    echo "  * Copy theme"
    echo "      cp ./new/* /usr/share/pixmaps/wicd/"
    echo "Enjoy."
else
    echo "Aborting (please copy the missing files to the same directory)"
fi

Sample icons
http://up.nullcat.de/3a81aba5X532dX4041 … ple.tar.gz

Any advices or comments?
When it comes to bash scripting i'm a beginner, so please be gentle.

Last edited by rebugger (2009-07-03 08:23:26)

Offline

#2 2009-07-03 01:53:31

Arm-the-Homeless
Member
Registered: 2008-12-22
Posts: 273

Re: wicd - easy icon theme creation

Why do you have

CP="/bin/cp"
ECHO="/bin/echo"
MKDIR="/bin/mkdir"

?

Just saying cp/echo/mkdir in the script instead of declaring it a variable will work.

Offline

#3 2009-07-03 08:17:04

rebugger
Member
From: Germany
Registered: 2007-10-28
Posts: 229

Re: wicd - easy icon theme creation

I thought of an rsync-backup-script I read days ago: http://www.mikerubel.org/computers/rsync_snapshots/
But you are right.

Offline

#4 2010-02-22 20:38:22

frigaut
Member
From: Canberra, Australia
Registered: 2009-05-10
Posts: 215
Website

Re: wicd - easy icon theme creation

Handy.
Thanks for icons (or more precisely for the translation script), there are indeed much nicer.
One note: I had in my existing icons a no-signal.png that your script didn't create. Not a problem adding it, just thought I'd let you know.


Samsung NP900X3F / MBP retina mid-2012.  Archer since 03/2009 / Arch donor

Offline

Board footer

Powered by FluxBB