Run something if battery is (dis)connected

Status
Not open for further replies.

Osiris

Golden Master
Messages
36,817
Location
Kentucky
It sometimes happens by accident that the power cable gets disconnected when you work with your notebook. It does not have to be by accident though, maybe you want to use the notebook in a different location without having to save everything and boot again. The problem that arises when a power cable gets disconnected is that the notebook loses battery power which is a huge problem if the battery was not loaded fully.
Battery Run is a little command line utility that checks if a power cable is connected. Once it gets disconnected it starts a user defined action and another one when the cable gets connected again. You could for instance play a sound if the power cable gets disconnected to notify you or a software that would reduce power consumption.
Usage is straightforward. Download and unpack the file on your hard drive. Use the command batteryrun load-program-when-disconnected load-program-when connected. For example: batteryrun disconnected.wav connected.wav
Batteryrun will play the disconnected.wav file when the power cable gets disconnected and the connected.wav file when it gets connected again. A icon should appear in the system tray if everything was setup correctly.

Run something if battery is (dis)connected : Welcome To Tech-Dump
 
Status
Not open for further replies.
Back
Top Bottom