Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Mar 24th, 2013  |  syntax: Bash  |  size: 0.65 KB  |  views: 53  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. #!/bin/bash
  2.  
  3. #killx() {
  4. #       proc=`ps xa | grep "X :1" | grep "SL" | awk '{print $1}'`;
  5. #       if [ $proc ]; then
  6. #               kill proc;
  7. #       fi;
  8. #}
  9.  
  10. bin=$1
  11. [ -x "$bin" ] && bin=$(readlink -f "$bin")
  12. [ -x "$bin" ] || bin=$(which "$bin" 2>/dev/null)
  13. [ -x "$bin" ] || { echo "No such executable \"$1\""; exit 1; }
  14.  
  15. #       killx && sleep 1
  16. #       # http://www.linuxquestions.org/questions/showthread.php?threadid=38281
  17. #       xauth add  :1 . `mcookie`
  18. #       X -screen "NX" :1 &
  19. #       DISPLAY=:1 $1
  20. #       sleep 1; killx
  21.  
  22. xauth add  :1 . `mcookie`
  23. export __GL_FSAA_MODE=5
  24. xinit "$bin" -- :1 #-xf86config xorg.conf -screen NX