Pages

How to Automatically Disable Compiz When Launching Games

When launching OpenGL games, google-earth etc you sometimes need to disable compiz.Most of you probably use fusion-icon or similar applications instead of enabling/disabling compiz via terminal.Today i will introduce you a very simple script to automatically disable compiz when launching applications/games, it will also restore the compiz after exiting the application.Unfortunately it is for Gnome only.All credits go to Amof from ubuntuforums.

Create an empty file called "game" under /usr/bin/ , via touch command and make it executable :

$sudo touch /usr/bin/game && sudo chmod +x /usr/bin/game

Open it via gedit or your favorite editor and paste the following :

$sudo gedit /usr/bin/game

#!/bin/bash

COMP="false";
if ps -A | grep compiz > /dev/null ; then
echo "Warning: Compiz Detected!!!"
metacity --replace > /dev/null &
COMP="true"
fi
echo "Starting"
$1
echo "Finish"
if $COMP ; then
echo "Warning: Starting Compiz!!!"
compiz --replace > /dev/null &
fi
exit


Save and exit.

Now you can just type game before before your application/game command.Example :

$game eternallands
$game wesnoth
For More Check Related Posts :


Preview on Feedage: pc-medicines Add to My Yahoo! Add to Google! Add to AOL! Add to MSN
Subscribe in NewsGator Online Add to Netvibes Subscribe in Pakeflakes Subscribe in Bloglines Add to Alesti RSS Reader
Add to Feedage.com Groups Add to Windows Live iPing-it Add to Feedage RSS Alerts Add To Fwicki
Add to Spoken to You

0 comments:

Post a Comment