How to start sailfish app in background when charger is connected
asked 2020-01-06 11:06:10 +0200
This post is a wiki. Anyone with karma >75 is welcome to improve it.
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.
situations app can start on plug in, use this or check the source there
pawel ( 2020-01-06 13:00:35 +0200 )editOnly a pointer since I don't know any technical details myself:
rozgwi ( 2020-01-06 19:32:39 +0200 )editYou'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.
and of course there's Battery Buddy
rozgwi ( 2020-01-06 19:38:05 +0200 )edit