Advertisement
Guest User

S.D.'s script to (almost) properly launch Unity3D games

a guest
Nov 10th, 2013
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. #!/bin/sh
  2. ##
  3. # 2012, S.D.
  4. ##
  5. # S.D.'s script to (almost) properly launch Unity3D games
  6.  
  7. # Assign absolute path to the game binary to the GAME_BINARY variable
  8. GAME_BINARY="/home/${USER}/bin/demos/Cornerstone/Linux_Build_2.3.x86_64"
  9.  
  10. if [ x"$GAME_BINARY" = x'' ]
  11. then
  12. echo "Set GAME_BINARY to the game binary's absolute path in script '$0'"
  13. exit 1
  14. else if [ ! -f "$GAME_BINARY" ]
  15. then
  16. echo "GAME_BINARY is not set to the path to the game's binary"
  17. exit 1
  18. else if [ ! -x "$GAME_BINARY" ]
  19. then
  20. echo "GAME_BINARY is not executable; fix permissions"
  21. exit 1
  22. fi
  23. fi
  24. fi
  25.  
  26. # Move to script's directory
  27. cd "`dirname $(realpath "$GAME_BINARY")`"
  28.  
  29. XWININFO_HEIGHT=$(xwininfo -root | grep Height | cut -d ' ' -f 4)
  30. XWININFO_WIDTH=$(xwininfo -root | grep Width | cut -d ' ' -f 4)
  31.  
  32. exec ${GAME_BINARY} -screen-height $XWININFO_HEIGHT -screen-width $XWININFO_WIDTH
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement