View Full Version : Disable Compiz When Launching Games?
grimdeath
June 30th, 2008, 10:21 PM
Sorry, I read a thread many months ago that stated how to do this but I cannot seem to find it now. Can someone explain how I could disable, and possibly re-enable the full version of compiz when I enter/exit a game.
I have problems with some games when compiz is turned on and have been manually toggling it off for now, just curious if there is a automatic way to make this work.
I am running quake wars from a desktop launcher if that helps.
Thanks!
S1xp4ck
June 30th, 2008, 10:58 PM
I use Compiz Switch which you can obtain Here (http://forlong.blogage.de/article/pages/Compiz-Switch) .
Basically it throws up a shortcut that will toggle your compiz settings on and off. Quite handy for us gamers.
grimdeath
June 30th, 2008, 11:54 PM
that works pretty well, now i just gotta remember to hit that button when I enter games :P that should do the trick though.
....now if i could just figure out why my sound works in everything but that game :P
atomkarinca
July 1st, 2008, 05:18 AM
You can write a bash script and make a shortcut. It can be something like this:
#!/bin/bash
metacity --replace
wine "~/.wine/drive_c/Program Files/dir/to/the/game/game.exe"
But after you quit you should also replace your window manager with compiz again:
compiz --replace
grimdeath
July 1st, 2008, 05:05 PM
thanks, compiz-switch seems to be doing the trick just fine.
drhabber
September 11th, 2008, 05:56 PM
You can write a bash script and make a shortcut. It can be something like this:
#!/bin/bash
metacity --replace
wine "~/.wine/drive_c/Program Files/dir/to/the/game/game.exe"
But after you quit you should also replace your window manager with compiz again:
compiz --replace
I have found a better solution (finally! :)) and it works like a charm:
I just use this script:
#!/bin/bash
# gamerun
#
# Sun Oct 28 07:17:37 2007
# Copyright 2007 Enrique Schiel
# <ecschiel@yahoo.com.ar>
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Library General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301, USA
CHANGE=0
if ps -e | grep compiz; then
CHANGE=1
fi
if [ $CHANGE == 1 ]; then
printf "Disabling advanced desktop efects...\n"
/usr/bin/metacity --replace &
fi
printf "Running the game...\n"
$@ &
wait $!
if [ $CHANGE == 1 ]; then
printf "The game is finished. Restoring advanced desktop efects...\n"
/usr/bin/compiz --replace &
fi
exit 0
With this one, I only have to do, for example, to run ZSNES, "gamerun zsnes". Metacity will replace Compiz, the game will run, and after it's done, Compiz will come back. I've already modified all of my opengl game shortcuts with this.
I didn't make this script, but I don't remember where I got it from. The guy's name is up at the top of the script. I just changed its name and added exit 0 to the end.
vBulletin® v3.8.4, Copyright ©2000-2012, Jelsoft Enterprises Ltd.