Need help with QML and systemd service creation
-
Hi,
I try to convert a Project from UB 16.04 to 20.04
but have the issue that a switch "Stop charging after limit reached" is not working.Could somebody help me ?
I did not understand why.
I belive that the Service may be not installed.gitlab --> ubtouch2 / fork-indicator-upower
Sorry did not have the right to post a link
-
@ds2k5 said in Need help with QML and systemd service creation:
Hi,
I try to convert a Project from UB 16.04 to 20.04
but have the issue that a switch "Stop charging after limit reached" is not working.Could somebody help me ?
I did not understand why.
I belive that the Service may be not installed.gitlab --> ubtouch2 / fork-indicator-upower
Sorry did not have the right to post a link
indeed, we use now systemd, you can find an example here in
https://gitlab.com/lduboeuf/battery-saveri can't show you exactly since i'm on UT with Morph bot supporting gitlab anymore but you should find a .service somewhere and the service installation is done with a python script
-
thank you !
-
Hi,
how to find the systemd script for your APP ?did install the APP but did not find a systemd script
phablet@ubuntu-phablet:~$ systemctl | grep -i batt phablet@ubuntu-phablet:~$
phablet@ubuntu-phablet:~$ ls -la /opt/click.ubuntu.com/batterysaver.lduboeuf total 12 drwxr-xr-x 3 clickpkg clickpkg 4096 Oct 28 07:00 . drwxr-xr-x 41 clickpkg clickpkg 4096 Oct 28 07:00 .. drwxr-xr-x 7 clickpkg clickpkg 4096 Oct 28 07:00 1.8.0 lrwxrwxrwx 1 clickpkg clickpkg 5 Oct 28 07:00 current -> 1.8.0
$ ls -la /home/phablet/.local/share/batterysaver.lduboeuf/batterysaver ls: cannot access '/home/phablet/.local/share/batterysaver.lduboeuf/batterysaver': No such file or directory
$ ls -la /home/phablet/.local/share/batterysaver.lduboeuf/ ls: cannot access '/home/phablet/.local/share/batterysaver.lduboeuf/': No such file or directory
Did deinstall the APP an reInstall but the binary is not there
$ ls -la /home/phablet/.local/share/batterysaver.lduboeuf/batterysaver
ls: cannot access '/home/phablet/.local/share/batterysaver.lduboeuf/batterysaver': No such file or directory -
@ds2k5 Now that i am on PC, it should be better
So to check the current status of the background user service:
systemctl status --user batterysaver
we can see that/home/phablet/.config/systemd/user/batterysaver.service
is used.So user service has to be copied to /home/phablet/.config/systemd/user/ and started accordingly, this is what is done with that python script:
https://gitlab.com/lduboeuf/battery-saver/-/blob/main/src/main.py?ref_type=heads#L16 -
thanks for explain
$ /home/phablet/.config/systemd/user/batterysaver.service -bash: /home/phablet/.config/systemd/user/batterysaver.service: Permission denied
~$ systemctl status --user batterysaver ● batterysaver.service - Battery saver Loaded: loaded (/home/phablet/.config/systemd/user/batterysaver.service; enabled; vendor preset: enabled) Active: active (running) since Mon 2024-10-28 10:18:03 CET; 16min ago Main PID: 9322 (batterysaver) CGroup: /user.slice/user-32011.slice/user@32011.service/batterysaver.service └─9322 /home/phablet/.local/share/batterysaver.lduboeuf/batterysaver /ril_1 gsm lte false true true Oct 28 10:21:56 ubuntu-phablet batterysaver[9322]: lockStateChanged(): screenIsLocked false Oct 28 10:21:56 ubuntu-phablet batterysaver[9322]: lockStateChanged(): switching to pref tech Oct 28 10:21:56 ubuntu-phablet batterysaver[9322]: lockStateChanged(): NOW SWITCHING TO "lte" Oct 28 10:22:58 ubuntu-phablet batterysaver[9322]: lockStateChanged(): screenIsLocked true Oct 28 10:22:58 ubuntu-phablet batterysaver[9322]: lockStateChanged(): NOW SWITCHING TO "gsm" Oct 28 10:24:41 ubuntu-phablet batterysaver[9322]: lockStateChanged(): screenIsLocked false Oct 28 10:24:41 ubuntu-phablet batterysaver[9322]: lockStateChanged(): switching to pref tech Oct 28 10:24:41 ubuntu-phablet batterysaver[9322]: lockStateChanged(): NOW SWITCHING TO "lte" Oct 28 10:25:58 ubuntu-phablet batterysaver[9322]: lockStateChanged(): screenIsLocked true Oct 28 10:25:58 ubuntu-phablet batterysaver[9322]: lockStateChanged(): NOW SWITCHING TO "gsm"
-