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?
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?