Last week I've stumbled upon this article with the title "The Cost Of Running Compiz" that bashes Compiz Fusion for killing Linux gamers (is this oxymoron or what?) frame rates. Doctor is in the house. Read on...
It would be ideal that you can have Compiz with ton of eye candy and glitch free 3D games. We know that doesn't work. But instead wouldn't it be possible to have our eye candy Compiz disabled while gaming and re enabled when returned to desktop? Sure. Peace of cake. Here's the idea and the steps to do so...
My idea is to make simple BASH script that could be used to launch our favorite games. Then we could replace launcher of any game that has Compiz illness (urban terror anyone?) with our script. We will pass name of the game as a parameter to our script. Additionally i love my 3D games with Anti-alliasing and Anisotropic filtering and my Compiz without it. We can do that too if we have Nvidia card at hand.
Step 1. (only NVIDIA owners)
If you have ATI card, skip this step. If you have NVIDIA card and want to automatically load Nvidia profile when you start your game, and unload it after you exit game, you do this... Run Nvidia Settings tool to make our settings profile for 3D games (AAA and AF). Press Alt+F2 and type
and press Enter. You can also navigate through menus to find Nvidia X Server Settings item. Now you set up your 3D games profile (AAA and AF as you wish) and click nvidia-settings Configuration from the left pane of the window. Click Save Current Configuration and then save it under .games-settings-rc file name in your home directory. After saving your 3D games profile in your home directory you return your Nvidia settings to the default (no AAA and AF) or whatever you want to be your default every day settings and click Quit.
Step 2. (Both NVIDIA and ATI cards)
Now you must download my scripts by clicking on the link at the end of this article. In zip file there are two scripts:
- game-starter-nvidia-v0.2.sh - this one uses created Nvidia 3D profile to tweak AAA and AF when you start your favorite game and also disables Compiz while gaming. After you quit game your settings are rolled back to no AAA/AF with compiz turned on or whatever is your default in your nvidia-settings. This one works with NVIDIA cards only (at least for now)!
- game-starter-all-v0.2.sh - this one just disables Compiz when in the game, and enables it when you are back on desktop. Works with both NVIDIA and ATI cards!
Choice between two versions of the script is yours depending whether you want to manage your AAA and AF setting manually and whether you have NVIDIA or ATI card in your box.
First download the scripts and put them to your home directory. We will now unpack them to ~/bin directory because bin directory in users home is by default in ones environment PATH. This way you can run your scripts without typing full path.
To install scripts you can use following code:
mkdir ~/bin && tar -xjvf 'game-starter-v0.2.tar.bz2' -C ~/bin/
- Initial release.
- Now this scripts can detect if compiz isn't running and in that case do nothing to suspend it when you enter the game. Besides that v0.2 scripts will use Ubuntu Notify OSD to inform you when Compiz is being suspended and restarted.
Step 3. (both NVIDIA and ATI cards)
Now start you game without worrying about Compiz killing your fun. Use this commands:
or if you have selected game-starter-nvidia-v0.2.sh
Example: For starting Urban Terror with disabled Compiz and with use of .games-settings-rc Nvidia profile for AA and AF settings I would type this:
Now the best part, you can modify your menu game launchers for games with this little script. You can use different script whether particular game has AAA and AF settings in its options menu or not. Once you set it up, you forget about it.
Please comment if script works or especially if it doesn't by clicking on the link at the top of this article (registration not necessary to comment - for now).
HERE's the v0.1 of the script (all Ubuntu versions, doesn't detect is Compiz running or not but works great)