Advertisement
Guest User

small change

a guest
Jun 30th, 2013
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. #!/bin/bash
  2. SCRIPTPATH=$( cd "$(dirname "$0")" ; pwd -P )
  3.  
  4. function has_command()
  5. {
  6. command -v "$1" >/dev/null
  7. }
  8.  
  9. function show_message()
  10. {
  11. style=$1
  12. shift
  13. if ! zenity "$style" --text="$*" 2>/dev/null; then
  14. case "$style" in
  15. --error)
  16. title=$"Error"
  17. ;;
  18. --warning)
  19. title=$"Warning"
  20. ;;
  21. *)
  22. title=$"Note"
  23. ;;
  24. esac
  25.  
  26. # Save the prompt in a temporary file because it can have newlines in it
  27. tmpfile="$(mktemp || echo "/tmp/steam_message.txt")"
  28. echo -e "$*" >"$tmpfile"
  29. xterm -T "$title" -e "cat $tmpfile; echo -n 'Press enter to continue: '; read input" 2>/dev/null || \
  30. (echo "$title:"; cat "$tmpfile"; echo -n 'Press enter to continue: '; read input)
  31. rm -f "$tmpfile"
  32. fi
  33. }
  34.  
  35. if has_command java; then
  36. #FIX for some VM's other then METACITY
  37. #save old value before unsetting
  38. oldXMODIFIERS=$XMOFIFIERS
  39. unset XMODIFIERS
  40. cd $SCRIPTPATH
  41. java -Djava.library.path=lib/native/ -Xms1024M -Xmx1024M -Xss2048k -jar lib/xaos.jar
  42.  
  43. #If there were XMODIFIERS, set them again
  44. if [ ${#oldXMODIFIERS} -ge 1 ]; then
  45. echo "Setting XMODIFIERS to old value."
  46. export XMODIFIERS=$oldXMODIFIERS
  47. fi
  48. else
  49. show_message --error "Couldn't find java, please install it from openjdk.java.net"
  50. exit 1
  51. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement