PDA

View Full Version : Turning on Desktop Effects with battery / turning them off with power


SleepWalkerX
November 23rd, 2007, 02:40 AM
I'm on a notebook running gutsy. I'm trying to set it to where compiz starts when the ac power is plugged in and metacity replaces it when its just running off of the battery.

I made two scripts in /etc/acpi/events.

/etc/acpi/events/compiz

event=ac_adapter
action="/usr/bin/metacity --replace"

/etc/acpi/events/metacity

event=battery
action="/usr/bin/compiz --replace"

(and of course run /etc/init.d/acpid restart so i'm able to start using them)

It almost works well. Sometimes it'll just immediately start metacity when I disconnect my power cable, but sometimes it'll just stay in battery mode and sit there if i plug back in the power (and not start compiz).

I think I might know what the problem is. If you normally run the command "compiz --replace" in the terminal it'll replace metacity, but the command will sit there in the terminal and not completely end. Same with "metacity --replace".

Has anyone accomplished what I'm trying to do or have any suggestions?

RSingh
November 23rd, 2007, 02:45 PM
A nice idea, help anyone..

SleepWalkerX
November 25th, 2007, 10:36 PM
Anyone?

FuturePilot
November 25th, 2007, 11:19 PM
Try adding a & to the end like this
action="/usr/bin/metacity --replace &"
That will basically background the process so that it can continue with the rest.
Same for the Compiz command as well.

SleepWalkerX
December 1st, 2007, 08:48 AM
It still doesn't work well. I guess I'll just request this through launchpad.