View Single Post
nonsuch's Avatar
Posts: 584 | Thanked: 1,550 times | Joined on Sep 2019
#487
^ thanks for the tip, already implemented!

SailfishOS 3.3.0.16
Situations v3.2.258
Sonar 0.0.5

I solved it!
Something weird happened to the input field for the command for When = Charger. I moved around in it with arrow keys (special keyboard layout) and suddenly there was more text than there was before. I erased it. Still didn't work.
Then I looked at ~/.local/share/harbour-situations2application/harbour-situations2application/situations2/situations.json and found that the command entry had a superfluous '\n' at the end, like so: ... START\n
Apparently this was passed to the shell script _literally_ so that the case/esac did not match.
I removed it manually (edit the .json in nano).

Solution:
- no newlines at the end of the command
and/or
- add a * to the case/esac options:
START*)
STOP*)

It is working now, batterybuddy-daemon is active when I plug the charger in, and stops when I unplug it.
It just takes a couple of minutes to switch states; I guess that's by design (taking less resources).
__________________
N900 in 2020
SFOS in 2021
 

The Following User Says Thank You to nonsuch For This Useful Post: