So, I wan't to run it when start work on AC and this or better other script when start work from battery
I tried
- /etc/acpi/power.sh
- adding symlink to /etc/laptop-mode/battery-start
It seems to not working
So, I wan't to run it when start work on AC and this or better other script when start work from battery
I tried
It seems to not working
You should be able to do what you want with a script in /etc/pm/power.d
. Quoting from the HOWTO.hooks
file in pm-utils
:
How to write a pm-utils hook:
PARAMETERS
A pm-utils hook is simply an executable file that accepts at least one
parameter.
For hooks in power.d, the potential values of that parameter are:
- true -- the hook MUST perform whatever action is appropriate when the system
transitions TO battery power.
- false -- The hook MUST perform whatever action is appropriate when the system
transitions FROM battery power.
You might also want to read some of the existing power hooks in /usr/lib/pm-utils/power.d
for ideas about how to structure your script.
Note that if you use the pm-utils
interface, you'll be told whether you're on AC power or not through the first argument: if $1
is true
, then you're switching to battery power, and if it is false
then you're switching back to mains power.