So, I wan't to run it when start work on AC and this or better other script when start work from battery
- adding symlink to /etc/laptop-mode/battery-start
It seems to not working
You should be able to do what you want with a script in
You might also want to read some of the existing power hooks in
Note that if you use the
It's not really correct question. I get some error, but now I correct and my power.sh and it works
and it works
I achieve the similar goal by using acpi.
use /usr/bin/acpi_listen to catch the acpi event you want, on my lapttop, the event that fire when switch to battery is "ac_adapter ACPI0003:00 00000080 00000000". so I create a new event : /etc/acpi/events/switch-to-battery, below is the content:
Just do whatever you want in ac_adapter.sh. More examples can be found if acpi-support is installed.
Last, execute this command to make the new event to take effect.