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/gameOpen 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
exitSave and exit.
Now you can just type game before before your application/game command.Example :
$game eternallands$game wesnoth


2 comments:
wow ! it work really great.
I tried it with "urban terror". but when I closed the game the X server closed then it brought me to GDM !!
so I deleted the "exit" from the end of "game" script and now after closing the any game, it re-initiate compiz without restarting the X server :)
i'm on Intrepid 8.10, maybe Jaunty is different .. I dont know o_O
regards,
MaXo..
This is great! thanks =]
Post a Comment