home *** CD-ROM | disk | FTP | other *** search
/ PCNET 2006 September - Disc 1 / PCNET_CD_2006_09.iso / linux / puppy-barebones-2.01r2.iso / pup_201.sfs / usr / sbin / deskshortcut.sh < prev    next >
Encoding:
Linux/UNIX/POSIX Shell Script  |  2004-10-11  |  1.5 KB  |  34 lines

  1. #!/bin/sh
  2. #this is very primitive script to create desktop shortcut.
  3.  
  4.  
  5. while [ 1 ]
  6. do
  7.  
  8. RETSTR=`Xdialog --wmclass "desktopshortcut" --title "Create desktop shortcut" --stdout --left --separator "|" --2inputsbox "This is a very primitive script to create a shortcut in the icon-block at the\nbottom-right of the screen. for CREATING SHORTCUTS ANYWHERE ON THE DESKTOP, DO\nNOT USE THIS SCRIPT -- INSTEAD, OPEN ROX, GO TO /usr/local/bin AND DRAG AN ICON\nONTO THE DESKTOP -- IT IS THAT SIMPLE.\n\nif you really want an icon in the icon-block, then keep going with this script,\nelse exit. An example entry is shown, but you have to type in your own.\nThis script will insert a line into /root/.fvwm95rc, and you then have to exit\nfrom X graphics mode to the prompt then restart X for the shortcut to become\nvisible. You have to manually delete the line in /root/.fvwm95rc to remove the\nshortcut.\n\nNote: you can find programs in /usr/local/bin. The pixmap filename\nmust be chosen from /usr/local/lib/X11/pixmaps folder." 0 0 "Program filename:" "skipstone" "Pixmap:" "nis24.xpm"`
  9.  
  10. RETVAL=$?
  11. case $RETVAL in
  12.  0) #ok
  13.   PROGFILE=`echo -n "$RETSTR" | cut -f 1 -d "|"`
  14.   PROGPIXMAP=`echo -n "$RETSTR" | cut -f 2 -d "|"`
  15.   SEDSTUFF="s/SHORTCUTSSTART/SHORTCUTSSTART\n*FvwmButtons $PROGFILE $PROGPIXMAP Exec \"$PROGFILE\" $PROGFILE/g"
  16.   cat /root/.fvwm95rc | sed -e "$SEDSTUFF" > /tmp/fvwm95rc
  17.   sync
  18.   mv -f /root/.fvwm95rc /root/.fvwm95rc.bak
  19.   mv -f /tmp/fvwm95rc /root/.fvwm95rc
  20.   sync
  21.   break
  22.   ;;
  23.  1) #cancel
  24.   break
  25.   ;;
  26.  2) #help
  27.   ;;
  28.  *)
  29.   break
  30.   ;;
  31. esac
  32. done
  33.  
  34.