Results 1 to 3 of 3

Thread: Using power status trigger

  1. #1
    Join Date
    Aug 2009
    Beans
    16
    Distro
    Ubuntu 10.04 Lucid Lynx

    Lightbulb Using power status trigger

    I wanted to use the power status of my laptop in my programs
    like how do I use power status to trigger some actions

    For example
    if power status changes from charging to battery start/stop a service
    or if battery power falls below some percentage sleep

    NOT that i want to make some power manager for my system
    just take the inputs from the power status to do stuff in form of bash scripts

  2. #2
    Join Date
    Nov 2008
    Location
    Sussex, England
    Beans
    871
    Distro
    Lubuntu

    Smile Re: Using power status trigger

    Quote Originally Posted by bipin.nag View Post
    I wanted to use the power status of my laptop in my programs...
    Well you could look at: /proc/acpi/ac_adapter/AC/state
    which may look something like this:-
    Code:
    state:                   off-line
    ...when on battery, or this:-
    Code:
    state:                   on-line
    ...when running from the charger.

  3. #3
    Join Date
    Aug 2009
    Beans
    16
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Using power status trigger

    Thanks that is what I was looking for

Tags for this Thread

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
  •