I would like to have a bash script to be executed when I switch to battery alimentation, is this possible?
Asked
Active
Viewed 563 times
1 Answers
1
yes there is a way.
From the Advanced Power Management (APM) daemon (apmd) man-page . This is a program. so when you remove the battery automatically this program will run. so you can use a condition to check the status of this program. If condition done then you can run the script else you can wait until it will runs.
change power
Invoked when the APM subsystem reports a change in power status,
such as a switch from mains to battery power.
Raja G
- 105,327
- 107
- 262
- 331