How to start sailfish app in background when charger is connected

asked 2020-01-06 11:06:10 +0300

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

updated 2020-01-06 11:09:49 +0300

venki gravatar image

Hi , I am trying to develop a simple sailfish app to notify the user when the battery charge percentage is reached certain point, say 90%, and i need to start this app when ever the charger is connected. Tried using systemd service and was able to start the app at startup but i want the app to be started only when the charger is connected.

Any suggestions / Code samples might help.

edit retag flag offensive close delete

Comments

1

situations app can start on plug in, use this or check the source there

pawel ( 2020-01-06 13:00:35 +0300 )edit
1

Only a pointer since I don't know any technical details myself:
You'd need to run a system daemon. Have a look at systemd units (Sailunit let's you browse the unit files used on Sailfish OS).
As for example code: It might use a different approach than systemd units for the daemon but WiFiKilL3r has one running in order to shut down WLAN automatically after disconnecting.

rozgwi ( 2020-01-06 19:32:39 +0300 )edit
2

and of course there's Battery Buddy

rozgwi ( 2020-01-06 19:38:05 +0300 )edit