You are not logged in.

#1 2012-09-22 15:04:06

From: Germany
Registered: 2011-10-03
Posts: 22

Detect ac changes while in sleep mode/after wakeup

Hey guys, I'm using acpid’s scripts to set some system settings when ac power is plugged in or out, but this obviously doesn’t work when the machine is sleeping. So, when I set my netbook into sleep mode, plug/unplug ac connection and wake it up again, it doesn’t notice the change and the acpid scripts aren’t executed as I they should.

Is there an easy way to detect ac changes right after waking up from sleep mode and run the acpid scripts accordingly or do I have to implement this myself somehow?


#2 2012-09-22 15:18:37

From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,412

Re: Detect ac changes while in sleep mode/after wakeup

Create a script and put it in /lib/systemd/system-sleep for sleep/wake, and I just create a small script and service file to determine its status at boot.

Check out /sys/class/power_supply/AC/online (your machine might label your ac adapter differently, so it may not be 'AC')

Last edited by WonderWoofy (2012-09-22 15:19:55)


Board footer

Powered by FluxBB