Xfce Forum

Sub domains
 

You are not logged in.

#1 2011-11-24 15:16:25

sb56637
Member
Registered: 2011-11-24
Posts: 1

XFCE power manager- How to run command on AC power connect/disconnect?

Hi, I'm using XFCE 4.8 on openSUSE 12.1.

I have a laptop that has problems with ACPI and the normal screen brightness controls on XFCE power manager don't work and probably never will work until the kernel gets fixed. However, I can run "sudo /sbin/setpci -s 00:02.0 F4.B=10" to to change my screen brightness. How can I make XFCE power manager run that command when the AC power is connected, and a similar command when AC power is reconnected?

Thanks a lot for your help!

Last edited by sb56637 (2011-11-24 15:17:07)

Offline

#2 2011-11-28 14:28:05

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,004

Re: XFCE power manager- How to run command on AC power connect/disconnect?

I don't use openSuse, but this should work. If you have pm-utils installed, drop an executable script into /etc/pm/power.d in the following format:

#!/bin/sh

case $1 in
    true)   # on battery power
              # do nothing
    ;;
    false)  # on a/c power
              /sbin/setpci -s 00:02.0 F4.B=10
    ;;
    *) 
    ;;
esac
exit 0

Have a look at the other scripts in /usr/lib/pm-utils/power.d for examples.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

Board footer

Powered by FluxBB