SHARE
TWEET

small change

a guest Jun 30th, 2013 88 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top