deskshortcut.sh 1.6 KB

1234567891011121314151617181920212223242526272829303132333435
  1. #!/bin/sh
  2. #Lesser GPL licence v2 (http://www.fsf.org/licensing/licenses/lgpl.html)
  3. #this is very primitive script to create desktop shortcut.
  4. while [ 1 ]
  5. do
  6. 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"`
  7. RETVAL=$?
  8. case $RETVAL in
  9. 0) #ok
  10. PROGFILE=`echo -n "$RETSTR" | cut -f 1 -d "|"`
  11. PROGPIXMAP=`echo -n "$RETSTR" | cut -f 2 -d "|"`
  12. SEDSTUFF="s/SHORTCUTSSTART/SHORTCUTSSTART\n*FvwmButtons $PROGFILE $PROGPIXMAP Exec \"$PROGFILE\" $PROGFILE/g"
  13. cat /root/.fvwm95rc | sed -e "$SEDSTUFF" > /tmp/fvwm95rc
  14. sync
  15. mv -f /root/.fvwm95rc /root/.fvwm95rc.bak
  16. mv -f /tmp/fvwm95rc /root/.fvwm95rc
  17. sync
  18. break
  19. ;;
  20. 1) #cancel
  21. break
  22. ;;
  23. 2) #help
  24. ;;
  25. *)
  26. break
  27. ;;
  28. esac
  29. done