Notices


Reply
Thread Tools
Posts: 4 | Thanked: 1 time | Joined on Apr 2015
#11
Does no more, no less, than what it should, great app.

I understand harbour apps cannot autostart, but I was thinking maybe it would be possible to be done manually with systemd. No success so far.

I created a .service file

/etc/systemd/system/batteryoverlay.service
Code:
[Unit]
Description=Start Battery Overlay

[Service]
ExecStart=/usr/bin/harbour-batteryoverlay

[Install]
WantedBy=multi-user.target
Tried enabling it, then reboot, but it fails.
As a second attempt I created a .timer for it.

/etc/systemd/system/batteryoverlay.timer
Code:
[Unit]
Description=Start Battery Overlay

[Timer]
OnStartupSec=45

[Install]
WantedBy=multi-user.target
After disabling the service, enabling the timer + reboot, it still fails.
Being new to systemd I'm probably missing something, but maybe someone can improve this approach.
 
Community Council | Posts: 4,113 | Thanked: 9,871 times | Joined on May 2012 @ Southerrn Finland
#12
Without trying it myself, I'd rather guess you want to invoke it as user service rather than system service.
Also, make sure it starts after UI session, either it probably fails.
 

The Following 2 Users Say Thank You to juiceme For This Useful Post:
Schturman's Avatar
Posts: 5,315 | Thanked: 4,079 times | Joined on Jan 2010 @ Israel
#13
hlev80, try this:
Code:
[Unit]
Description=Start Battery Overlay
After=ofono.service

[Service]
Type=simple
Environment="DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/100000/dbus/user_bus_socket"
ExecStart=/usr/bin/harbour-batteryoverlay

[Install]
WantedBy=multi-user.target
Give to this name like: overlayautostrat.service
and put it to: /lib/systemd/system
run as ROOT:
Code:
systemctl enable overlayautostrat.service

UPDATE:
Just now tested and it also not work

Last edited by Schturman; 2015-04-03 at 20:32.
 

The Following User Says Thank You to Schturman For This Useful Post:
coderus's Avatar
Posts: 6,063 | Thanked: 11,221 times | Joined on Nov 2011 @ Open Mobile Platform, Innopolis, Russia
#14
will try to add some hidden hack for enabling autostart. fooling harbour QA should be easy
__________________
Twitter | Openrepos | GitHub | PayPal.Me
 

The Following 3 Users Say Thank You to coderus For This Useful Post:
Posts: 4 | Thanked: 1 time | Joined on Apr 2015
#15
Thank you all!

As said, I haven't been too familiar with systemd. I looked up how to deploy a user service and it works that way.

/etc/systemd/user/batteryoverlay.service
Code:
[Unit]
Description=Start Battery Overlay

[Service]
ExecStart=/usr/bin/harbour-batteryoverlay

[Install]
WantedBy=default.target
I used a .timer as well to be safe and assumed everything it needs is started by then. (45sec is a bit long though, UI was ready in ~30)

/etc/systemd/user/batteryoverlay.timer
Code:
[Unit]
Description=Start Battery Overlay

[Timer]
OnStartupSec=45

[Install]
WantedBy=default.target
As root:
systemctl --user enable batteryoverlay.timer
 

The Following User Says Thank You to hlev80 For This Useful Post:
Schturman's Avatar
Posts: 5,315 | Thanked: 4,079 times | Joined on Jan 2010 @ Israel
#16
hlev80, thanks it work after reboot, but it not work after homescreen refresh (lipstick)
I tried to add "After=lipstick.service" under Unit in both files, but still not work..
 
Posts: 1,040 | Thanked: 3,431 times | Joined on Oct 2014
#17
Try to add
Restart =always
__________________
You can still support my work by donation - click here

ETH: 0xf7544913017653719259c92d38d50d9d55f7c6cd
 
Schturman's Avatar
Posts: 5,315 | Thanked: 4,079 times | Joined on Jan 2010 @ Israel
#18
Yes, already fixed
service:
Code:
[Unit]
Description=Start Battery Overlay
After=lipstick.service

[Service]
ExecStart=/usr/bin/harbour-batteryoverlay
Restart=always

[Install]
WantedBy=default.target
 
Schturman's Avatar
Posts: 5,315 | Thanked: 4,079 times | Joined on Jan 2010 @ Israel
#19
if someone want here is a small package for this. It will auto enable after installation, and just reboot your phone once after installstion.
Icon for easy remove..
https://db.tt/lWbVl5pO
 

The Following 3 Users Say Thank You to Schturman For This Useful Post:
Posts: 4 | Thanked: 1 time | Joined on Apr 2015
#20
Originally Posted by Schturman View Post
Yes, already fixed
service:
Code:
[Unit]
Description=Start Battery Overlay
After=lipstick.service

[Service]
ExecStart=/usr/bin/harbour-batteryoverlay
Restart=always

[Install]
WantedBy=default.target
I guess this works without the timer already.
 
Reply

Tags
battery, overlay, sailfishos

Thread Tools

 
Forum Jump


All times are GMT. The time now is 14:26.