When run on batterie disable compiz?

Asked by KamiKasi

Is it possible that compiz gets disabled automatically if my notebook runs on batterie?

On AC there is no problem with using Compiz on my Amilo Xi1526 but on batterie mode it needs more power than with metacity. So I have to deactivate compiz than. And I think it would be the best when this is done automatically.

Is there somewhere a function that realize this? Or could someone build such a function?

I think this would help many people out there with neet of batterie time... ;)

Thanks,
Karsten

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu compiz Edit question
Assignee:
No assignee Edit question
Solved by:
Christoph Langner
Solved:
Last query:
Last reply:
Revision history for this message
Best Christoph Langner (chrissss) said :
#1

Yep. acpi can do this for you. Create two scripts

/etc/acpi/battery.d/compiz.sh

----
#!/bin/bash
DISPLAY=:0. metacity --replace
----

and

/etc/acpi/ac.d/compiz.sh

----
#!/bin/bash
DISPLAY=:0. compiz --replace
----

and set the rights

# sudo chmod 755 /etc/acpi/ac.d/compiz.sh
# sudo chmod 755 /etc/acpi/battery.d/compiz.sh

From now on, the window manager should be changed when you change plug in or out your notebook. I didn't test it, but you should be on the right way.

Revision history for this message
KamiKasi (rungeka) said :
#2

Sounds very good to me, but it doesn't work...

Checked the scripts and rights twice, there must be a (little) problem with the scripts. They do not seem to run.

Revision history for this message
Witold Krakowski (wkrakowski-gmail) said :
#3

Do you run these scripts as normal user or as root? You should run them as root.

Revision history for this message
KamiKasi (rungeka) said :
#4

OK, I don't know why but now it is working.

Thank u all!

Revision history for this message
darek21p (darek-bocki) said :
#5

I have checked on my Ubuntu 7.10 and it works perfectly

Revision history for this message
KamiKasi (rungeka) said :
#6

Thanks Christoph Langner, that solved my question.