Code Sample |
#!/bin/sh DIA="Xdialog --wmclass" $DIA --2inputsbox "Please enter a name and a command for your icon." 0 0 "Name:" "" "Command:" "" 2>/tmp/tic ICON_NAME=`cat /tmp/tic | perl -e '$x=<>;if($x=~/^(.*?)\/.+/{print $1}'` ICON_CMD=`cat /tmp/tic | perl -e '$x=<>;if($x=~/^(.*?)\/(.*)/{print $2}'` $DIA --msgbox "Now choose a picture for your icon." 0 0 $DIA --fselect /home/knoppix/.xtdesktop 0 0 2> /tmp/tic ICON_PIC=`cat /tmp/tic` rm -f /tmp/tic cat <<EOF>/home/knoppix/.xtdesktop/$ICON_NAME.lnk table Icon Type: Program Caption: $ICON_NAME Command: $ICON_CMD Icon: $ICON_PIC X: 25 Y: 270 end EOF |
Code Sample |
#!/bin/sh DIA="Xdialog --wmclass --title Icon" $DIA --2inputsbox "Please enter a name and a command for your icon." 0 0 "Name:" "" "Command:" "" 2>/tmp/tic ICON_NAME=`cat /tmp/tic | perl -e '$x=<>;if($x=~/^(.*?)\/.+/{print $1}'` ICON_CMD=`cat /tmp/tic | perl -e '$x=<>;if($x=~/^(.*?)\/(.*)/{print $2}'` $DIA --msgbox "Now choose a picture for your icon." 0 0 $DIA --fselect /home/dsl/.xtdesktop 0 0 2> /tmp/tic ICON_PIC=`cat /tmp/tic` rm -f /tmp/tic cat <<EOF>/home/dsl/.xtdesktop/$ICON_NAME.lnk table Icon Type: Program Caption: $ICON_NAME Command: $ICON_CMD Icon: $ICON_PIC X: 25 Y: 270 end EOF |