#!/bin/sh # Convert KDE's icon to ROX # Only default apps, devices, and filesystems # usage() { echo << _EOF_ Convert KDE icons to ROX Usage: iconrox [rox_dir] Example iconrox noia _EOF_ exit 0 } # Global variables if [ "$UID" = "0" ]; then BASEDIR="/usr/share/icons" BASETARGET="/usr/share/icons" else BASEDIR="$HOME/.icons" BASETARGET="$HOME/,icewm" fi SIZE="48x48" mstandard() { TNAME=$1.png for INAME in $* ; do if [ -f $CICONS/$INAME.png ]; then convert $CICONS/$INAME.png -resize 36x36 $TICONS/$TNAME echo -n '+' return 0 fi done echo ?=$INAME } mtheme() { CICONS=$THEMEDIR/$SIZE/filesystems TICONS=$TARGET/filesystems mkdir -p $TICONS mstandard folder mstandard folder_home mstandard network mstandard network_local CICONS=$THEMEDIR/$SIZE/devices TICONS=$TARGET/devices mkdir -p $TICONS mstandard floppy_mount 3floppy_mount 2floppy_mount mstandard floppy_unmount 3floppy_unmount 2floppy_unmount mstandard cdrom_mount 3cdrom_mount mstandard cdrom_unmount 3cdrom_unmount mstandard cdwriter_mount 3cdwriter_mount mstandard cdwriter_unmount 3cdwriter_unmount mstandard dvd_mount mstandard dvd_unmount mstandard usbpendrive_mount mstandard usbpendrive_unmount mstandard zip_mount mstandard zip_unmount mstandard camera mstandard printer printer1 printer2 mstandard scanner mstandard modem CICONS=$THEMEDIR/$SIZE/apps TICONS=$TARGET/apps mkdir -p $TICONS ## Generic applications mstandard vector mstandard kmenu vector mstandard vasm package_settings mstandard vlapt package mstandard vecpkg vlapt package # Generic Apps # ----------------- mstandard package_editors kate mstandard html mstandard package_development mstandard java mstandard package_edutainment mstandard edu_mathematics mstandard edu_science mstandard edu_languages mstandard edu_plot kmplot mstandard package_games mstandard package_games_arcade mstandard package_games_board mstandard package_games_strategy mstandard package_graphics mstandard viewer xmag kview mstandard lineart krita mstandard diagram kfig kig mstandard cad designer mstandard package_multimedia mstandard audio arts kcmsound mstandard audio-editor artsbuilder mstandard video kaboodle #mstandard video-editor mstandard package_network mstandard browser ../filesystems/www mstandard ftp kget mstandard email kmail mstandard p2p ../filesystems/network mstandard gaim kopete mstandard chat mstandard news knewsletter mstandard package_office mstandard word kword mstandard spreadsheet kchart mstandard presentation kpresenter mstandard database package mstandard accounting kpercentage mstandard project korganizer mstandard collection bookcase mstandard package_settings mstandard style mstandard icons mstandard background mstandard package_system mstandard config kcontrol mstandard admin personal mstandard password mstandard package_utilities mstandard explorer mycomputer ../filesystem/folder mstandard console display mstandard rconsole krfb mstandard backup mstandard partition kcmpartitions mstandard security agent mstandard network_tools mstandard multimedia_tools artscontrol cd $CWD } ###################################################################### # Main program [ "$1" == "" ] && show_help [ "$1" == "-h" ] && show_help [ "$1" == "--help" ] && show_help if [ -d $1 ]; then THEMEDIR=$1 elif [ -d $BASEDIR/$1 ]; then THEMEDIR=$BASEDIR/$1 else echo "Cannot find icons $1" exit 1 fi if ! grep -qe "^[KDE Icon Theme]" $THEMEDIR/index.theme &> /dev/null && ! grep -qe "^[KDE Icon Theme]" $THEMEDIR/index.desktop &> /dev/null ; then echo "Excuse me, $THEMEDIR is not a KDE icon theme" exit 1 fi if [ "$2" ]; then TARGET=$2 else TARGET=`dirname $1`/ROX-`basename $1` fi mtheme