Auto-start for Situations app

Rating: 
3.94737
Your rating: None Average: 3.9 (19 votes)

This app for auto start Situations app (from jolla store) in background after reboot or lipstick restart.
Requires:
harbour-situations2application - should be installed.
python, dbus-python - to see notifications on the event screen.
lipstick-qt5-tools - to overwrite existing notification instead to collect them in the thread

Just activate developer mode before installation and dependencies packages should be installed automatically.

v0.1-17
- Small changes in the script.
- Compatible with v2.1.1.12.

v0.1-15
* Fix for ownership of some files. Now should work for all users. Added Tablet version.

v0.1-14
* Small changes in .spec file, changes for permission.

v0.1-13
* Small changes in .spec file

v0.1-12
* Small changes in .spec file

v0.1-11
* Added checking command if folder "user-session.target.wants" is existing. Now should work for all users.

v0.1-10
* Fixed small mistake in .spec file

v0.1-9
* App completely changed.
* Notification text changed a little bit.
* Will start service file after installation.
* Press on icon for stop/start service. If you will stop service, it will stop Situations app. Just reopen Situations app.
* Work also after reboot and lipstick restart
* Adaptation for 2.0.0.10.

v0.1-7
* Fix of notification icon. Adaptation for 1.1.9.28.

v0.1-6
* Fix of notification icon. Adaptation for 1.1.6.27.

v0.1-5
* Fix of small bug
* Added creating log file when Situation stuck over 90%, you will find it in /home/nemo/situationreboot.log.

v0.1-4
* Added auto-kill and restart of server if it stuck on over 90%, you will get notification about this. Thanks to Moth for Icons. .

v0.1-3
* Icon change to cool one, thanks to Moth.

v0.1-2
* Automatically enabled after installation.

Beware, use it on your own risk !!!

Donation are welcome :)

Screenshots: 
Application versions: 
AttachmentSizeDate
File situationreboot-0.1-15.armv7hl.rpm39.5 KB27/10/2015 - 21:40
File situationreboot-0.1-15.i486.rpm39.7 KB21/03/2016 - 05:34
File situationreboot-0.1-17.i486.rpm39.54 KB02/06/2017 - 18:38
File situationreboot-0.1-17.armv7hl.rpm40.44 KB02/06/2017 - 18:38
Changelog: 

- Small changes in the script.
- Compatible with v2.1.1.12

Comments

rdomschk's picture

Thank you for this nice tool. My question is - could you make also a root version for auto start situations, because since Sailfish V2.1.1.26 some funktions (WLAN and BT) in situations not work because "permission denied". Thanks in advance.

Schturman's picture

Hmmm... Need check it... And you know, you always can create scripts for this functions.

ixylon's picture

I can support rdomschk wish!

Thanks for auto-start, works nicely with situations3-beta!

Although a bit insecure a capable root-mode checkbox would be at least simple.. and save a lot of time on hacking everything (install gcc, make different wifi-on/off scripts, add full /home/nemo/bin/-path ...)

That's what I did:

chown root:root flight-on
chmod ug+s flight-on

#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>
int main(void)
{
if (setuid(0))
{
perror("setuid");
return 1;
}
if (setgid(0))
{
perror("setgid");
return 1;
}
char buffer[128];
int uid = getuid();
int gid = getgid();
snprintf(buffer, sizeof(buffer), "/usr/bin/logger flight-on uid %d gid %d", uid, gid);
system(buffer);
system("/bin/dbus-send --system --dest=com.nokia.mce --print-reply /com/nokia/mce/request com.nokia.mce.request.req_radio_states_change uint32:0 uint32:1");
return 0;
}

carmenluci's picture

Thanks for this app!! I'm using it, but I think there is something wrong: I created a situation to change mobile data to wifi, but it doesn't work if I restart my phone and auto-start for situations is active. However, if I uninstall auto-start and open Situations manually, this situation works fine.

Schturman's picture

Don't know what the problem... For me it work.
My app don't do nothing except to start Situations app at background:
ExecStart=/usr/bin/harbour-situations2application server

pseudoscion's picture

I cannot install any version now that I have updated to Sailfish 2.0.0.10. I uninstalled in the hope that it might install with a fresh install, but no.

I have Situations v2.5.80 installed from Jolla store.

When I try installing the required packages manually (as root) I get

pkcon install -y python

Installing
Status: Waiting in queue
Status: Waiting for authentication
Status: Waiting in queue
Status: Starting
Status: Refreshing software list
Percentage: 0
Status: Querying
Percentage: 10
Percentage: 40
Status: Resolving dependencies
Fatal error: python-libs-2.7.9-1.3.2.armv7hl requires python = 2.7.9-1.3.2, but this requirement cannot be provided

pseudoscion's picture

Ok, so I tried disabling developer mode, and now cannot re-enable developer mode :-( However, I have managed to install Situations-Reboot via Warehouse :-)

Schturman's picture

Hi.
Installed, good :) But why you can't enable dev mode I don't know... Maybe internet connection problem.

PawelSpoon's picture

Ok. Today i've disabled dev mode then reenabled it and installed the 1.10 version successfully. Strange but true

Schturman's picture

Ok, good to know!

Thanks for report..

PawelSpoon's picture

I have tried with 2.0.0 and developer mode on, can not install.

Edit: i have situations installed.

Verision 1.10 also fails

When i run pkcon i got two errors:

lipstick qt5 tools relies on lipstick qt5 and this cant be provided and python libs requires python ..

Edit: Transaction: Installing
Status: Waiting in queue
Status: Waiting for authentication
Status: Waiting in queue
Status: Starting
Status: Refreshing software list
Percentage: 0
Status: Querying
Percentage: 10
Percentage: 40
Status: Resolving dependencies
Results:
Fatal error: lipstick-qt5-tools-0.27.61.7-1.69.3.armv7hl requires lipstick-qt5 = 0.27.61.7-1.69.3, but this requirement cannot be provided
python-libs-2.7.9-1.3.2.armv7hl requires python = 2.7.9-1.3.2, but this requirement cannot be provided

Schturman's picture

Like I wrote before, try to install this packages one by one and show me outputs. Start with python package.
As root of course...

Schturman's picture

Can you show me full output of this command:
pkcon install -y python dbus-python lipstick-qt5-tools
Do screenshot or copy/paste from terminal. My app not work for you because for some reasons, your phone can't install dependencies packages. But what the problem I don't know... You need to try install them manually... Try one by one for example and show me output:
pkcon install -y python
pkcon install -y dbus-python
pkcon install -y lipstick-qt5-tools
And be sure you do it as ROOT...

Schturman's picture

I found and fixed a small mistake in the .spec file. Please, try to install a new version.

eson's picture

v0.1-10. Now it works fine again!  :)  Lets just hope it doesn't interfere with language in Situations notification.

Edit:

Rebooted 3 times and so far so good!  :)

Schturman's picture

Yep, please report about it. For checking just press on the icon for disable and press again for enable and you will see message from Situations app about your current status. And you will see which language used in the message.

Thanks

eson's picture

Looks like everything is ok for now, but the earlier language error was kind of random so we will have to wait and see. I'll report back if something happens.

Schturman's picture

Thanks for report...

Schturman's picture

1. Can you show me the error ?
2. The Situations app installed ?
3. Try to install required packages manually before installation of my package:
pkcon install -y python dbus-python lipstick-qt5-tools

eson's picture

Thanks for this app, it's really helpfull, but it allso changes the notification message (Current situation...) from native language back to English. I run Situations in Swedish and I would like to se notification in Swedish as well.

Do you think you can fix this?

Schturman's picture

Hi eson, please try new version and tell me if it also change your language notifications.
Thanks.

Schturman's picture

Hmmm... It use simple command for start Situations app:
/usr/bin/harbour-situations2application server &
I really don't know why language changed for you and how to fix it.

eson's picture

Ok, of course it might be a Situations issue, but it started again this morning after updating your app. Before this update it worked perfect, since I did factory reset on my phone (a month ago), therefore I thought it had someting to do with your app. The problem was the same before factory reset.

Schturman's picture

Thanks for comment. Really don't know what the problem. Just remove this app and I will remove it from open repos.

eson's picture

FYI... I did remove the app, and the language came back again.

MoritzJT's picture

I hope removal is only a temporary decission. We really need a way to have situations autostart ;-)

Schturman's picture

Please try new version and report here or on tmo...

Thanks.

Moth's picture

Situations app doesn't start on boot.

Can't switch between Active / Inactive (always Active)

How can I help? (1.1.9.28)

Schturman's picture

dev mode active ?

Moth's picture

Yes, sure. :-)

Pages