Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I installed the Extreme Tux Racer game in Ubuntu 11.10 from the Software Center but my screen expands abnormally after I start a game.

Before starting the game:

After closing the game

share|improve this question
add comment

2 Answers 2

up vote 4 down vote accepted

Extreme Tux Racer starts by default with a resolution width of 800 pixels. Exiting the game should restore your original resolution, but unfortunately it seems the game is crashing when you close, before it can re-resize your display

There is a workaround. You can set a custom game resolution by editing lines in ~/.etracer/options:

set x_resolution X
set y_resolution Y

where X and Y are your desired game width and height. If you set them to your normal resolution dimensions, the game should never "enlarge" your screen to begin with.

References

share|improve this answer
    
You're right :) –  Omegafil Jan 3 '12 at 12:07
    
Thanks! After editing the options file as per my original screen resolution, the problem is solved. –  ajantrik Jan 3 '12 at 16:02
add comment

You can wrap the game executable in simple script:

#!/bin/sh

# get current resolution
PREV_RES=$(xrandr -q | grep '^ *[0-9]*x[0-9]*' | awk '/\*/{print $1}')

# start the game
/path/to/my/game    # <---- CHANGE THIS !!!!

# restore previous resolution
xranrd -s $PREV_RES

Then use this script to start the game. I didn't test it on multi-monitor configuration. There might be better way to get current resolution than parsing xrandr.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.