#!/bin/sh # Remove all symlinks # Only 48x48 icons are used # Global variables if [ "$UID" = "0" ]; then BASEDIR="/usr/share/icons" else BASEDIR="$HOME/.icons" fi show_help() { echo "Usage: iconclear [icon_dir]" echo "CLear the softlinks in the icon_dir" echo echo "Example" echo "iconclear" echo " clear all $BASEDIR/*" echo echo "iconclear Icon" echo " clear $BASEDIR/Icon" echo echo "iconclear /path_to/Mine" echo " clear /path_to/Icon" exit 0 } clear_theme() { BASENAME=`basename $THEMEDIR` if [ -L $THEMEDIR ]; then echo Skipping default return 0 fi if [ ! -d $THEMEDIR ]; then echo $THEMEDIR is not a directory return 0 fi echo Clearing $THEMEDIR find $THEMEDIR -type l -exec rm {} \; } ###################################################################### # Main program [ "$1" == "" ] && show_help [ "$1" == "-h" ] && show_help [ "$1" == "--help" ] && show_help if [ "`dirname $1`" ]; then THEMEDIR=$1 else THEMEDIR=$BASEDIR/$1 fi clear_theme