PDA

View Full Version : [lubuntu] Shutdown on battery



Retor
September 26th, 2011, 09:10 PM
I'd like for the computer to shut down without the need for confirmation when the power source changes to battery.

I found "battery" in /etc/acpi/events/ - Content:




# /etc/acpi/events/battery
# Called when AC power goes away and we switch to battery

event=battery
action=/etc/acpi/power.sh


It points to /etc/acpi/power.sh:


#!/bin/sh

test -f /usr/share/acpi-support/key-constants || exit 0

. /usr/share/acpi-support/policy-funcs

if [ -z "$*" ] && ( [ `CheckPolicy` = 0 ] || CheckUPowerPolicy ); then
exit;
fi

pm-powersave $*


Not quite sure if this is the right place or what to put in it.

collisionystm
September 26th, 2011, 09:15 PM
Try it and see what happens

Retor
September 27th, 2011, 07:21 PM
But ... I don't know what to put in it :)

Or what the stuff that is in it now means!

collisionystm
September 28th, 2011, 08:55 PM
But ... I don't know what to put in it :)

Or what the stuff that is in it now means!
<code>
#!/bin/sh test -f /usr/share/acpi-support/key-constants || exit 0 . /usr/share/acpi-support/policy-funcs if [ -z "$*" ] && ( [ `CheckPolicy` = 0 ] || CheckUPowerPolicy ); then exit; fi pm-powersave $*
</code>