Running ut on a new x server (performance is everything)

This was a ha(n/r)dy guide:

http://ubuntuforums.org/showthread.php?t=51486

So because I am always losing with UT and keep blaming it on the poor performance of my laptop I was forced to optimise UT. After fiddling with new engines, I discovered that doesn't make any difference at all.

I logged out of gnome and stopped gdm. With xinit I started a new X(org) server, ran UT and voila: much better performance. But this are waaaay to many steps so I created some scripts to do this for me.

I have two scripts:

ut
This runs wine and invoked the UT binary

newscreen
This runs a new xserver without gnome or anything.

I placed both scripts in ~/bin

UT:

CODE:
  1. #!/bin/bash
  2. wine=`which wine`
  3.  
  4. $wine ~/.wine/drive_c/UnrealTournament/System/UnrealTournament.exe $*

newscreen:

CODE:
  1. #!/bin/bash
  2.  
  3. MINARGS=1
  4. E_NOARGS=70
  5. E_NOTEXE=71
  6. EXECUTABLE=`which $1`
  7.  
  8. NR_OF_SCREENS=`pgrep -x Xorg |wc -l`
  9. NEW_SCREEN=$(($NR_OF_SCREENS - 0))
  10.  
  11. if [ $# -lt $MINARGS ]; then
  12. echo "You have to use at least 1 argument in the form of an executable"
  13. exit $E_NOARGS
  14. fi
  15.  
  16. if [ ! -x "$EXECUTABLE" ]; then
  17. echo "The argument should be (the path to) an executable"
  18. exit $E_NOTEXE
  19. fi
  20.  
  21. xinit $* -- :$NEW_SCREEN > /dev/null

I am especially proud of the newscreen command. I think it's really nice. Especially because it counts the current number of running xservers. So if it's only one (usually) it creates :1. If there are more it raises the number.

The commands are used like:

CODE:
  1. newscreen ut #start ut on a new :1 server
  2. newscreen xclock #start xclock on :2

Nice eh?

0 comments ↓

There are no comments yet...Kick things off by filling out the form below.

Leave a Comment