Results 1 to 4 of 4

Thread: Shutdown on battery

  1. #1
    Join Date
    Jun 2008
    Beans
    43

    Shutdown on battery

    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:


    Code:
    # /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:

    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 $*
    Not quite sure if this is the right place or what to put in it.

  2. #2
    Join Date
    Feb 2011
    Location
    Maryland
    Beans
    2,259
    Distro
    Ubuntu

    Re: Shutdown on battery

    Try it and see what happens

  3. #3
    Join Date
    Jun 2008
    Beans
    43

    Re: Shutdown on battery

    But ... I don't know what to put in it

    Or what the stuff that is in it now means!

  4. #4
    Join Date
    Feb 2011
    Location
    Maryland
    Beans
    2,259
    Distro
    Ubuntu

    Re: Shutdown on battery

    Quote Originally Posted by Retor View Post
    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>

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •