We have moved to a new Sailfish OS Forum. Please start new discussions there.
12

Problem with "Exec=" and "Single-Instance" in .desktop files on Sailfish OS 3 [released]

Tracked by Jolla (In release)

asked 2018-11-18 20:09:16 +0200

Dietmar gravatar image

updated 2020-02-02 00:56:44 +0200

Federico gravatar image

I'm using some applications written in Python. So the "Exec" and "Single-Instance" lines in the .desktop files look like:

Exec=python3 /path/to/application/app.py
X-Nemo-Single-Instance=no

The second app obviously has a different /path/to/application/app.py.

With the upgrade to revision 3, I can only start one such app. Trying to start the second does only bring the focus to the running first app.

So there are two bugs:

  • It seems that Sailfish OS 3 does only evaluate the binary name to check whether an app is running already, i.e. it identifies both apps as "python3" instead of the full path or the name of the desktop file.
  • The Single-instance setting is not obeyed.

With Sailfish OS 2 I did not have these issues. The workaround is trying to start both apps within a fraction of a second.

The ps entries of both apps:

nemo      5458  4.8  1.4 111424 43012 ?        Ssl  19:03   0:01 /usr/bin/python3 /home/nemo/PySideMp3/PySideMp3.py
nemo      5462  0.0  0.0   3972   776 ?        S    19:03   0:00 invoker --type=generic python3 /home/nemo/PySideMp3/PySideMp3.py
nemo      5464 28.1  1.3 127416 40368 ?        Ssl  19:03   0:05 /usr/bin/python3 /home/nemo/UniversalRemote3/UniversalRemote.py
nemo      5466  0.0  0.0   3972   776 ?        S    19:03   0:00 invoker --type=generic python3 /home/nemo/UniversalRemote3/UniversalRemote.py

Edit to bump this issue. This is fundamental functionality that has regressed!

edit retag flag offensive reopen delete

The question has been closed for the following reason "released in a software update" by coderus
close date 2020-05-15 15:40:18.747515

Comments

Actually, why python3 in the Exec line when it could be directly the .py, with #!/usr/bin/python3 there?

Having said that, always good if things are robust. Any combination of store apps that are triggered by this?

Pekka Vuorela ( 2020-01-31 16:27:14 +0200 )edit

The whole line should still be considered as the command to execute.

Tanghus ( 2020-01-31 20:15:14 +0200 )edit

3 Answers

Sort by » oldest newest most voted
7

answered 2020-04-27 11:24:50 +0200

jovirkku gravatar image

Fixed in OS release 3.3.0.

edit flag offensive delete publish link more

Comments

2

much wow!!

coderus ( 2020-04-27 11:46:40 +0200 )edit
3

answered 2020-01-28 05:44:43 +0200

teleshoes gravatar image

easy fix:

[/usr/share/lipstick-jolla-home-qt5/switcher/Switcher.qml]

79c79,80
<         if (index >= 0) {
---
>         var singleInstance = launcherItem.readValue("X-Nemo-Single-Instance")
>         if (index >= 0 && singleInstance !== "no") {
edit flag offensive delete publish link more

Comments

Excellent, then it will be even easier for the sailors to fix this regression. A patch is useless if the functionality is to be used in an app you have created to be used by other people.

PS: Another time you could "reuse" the same answer instead of creating a new :)

Tanghus ( 2020-01-28 07:40:07 +0200 )edit
1

kinda different answers tho. one is a minimal patch to restore desired behavior following the regression, other is a hakkx that works better for me (and that someone else might find useful maybe) but its also dirty and weird and probably shouldnt be upvoted.

either way, youre right, SFOS apparently doesnt have the resources to fix horrible phone-destroying bugs. see: https://together.jolla.com/question/128155/bug-mobile-data-connection-dies-since-201x/

teleshoes ( 2020-01-28 07:47:48 +0200 )edit

"A patch is useless if the functionality is to be used in an app you have created to be used by other people."

perhaps put it in a patchmanager3-patch and make your app depend on that patch? still requires manual fukkery on the endusers' part, but SFOS isnt polished enough yet for folks who cant be bothered toggling a switch in a UI

EDIT: actually its already there https://coderus.openrepos.net/pm2/project/sailfishos-launcher-multi-instances-patch

teleshoes ( 2020-01-28 07:51:44 +0200 )edit

Thanks. The patch is a better workaround than my previous of launching both programs within a second or so. It's not 100% correct as now different .desktop files may influence each other, as still only the first part of the Exec path is checked.

But anyway the real problem is that without a bug tracker etc. patches don't find their way into Sailfish OS. TJC is not suitable for this.

Dietmar ( 2020-02-02 12:57:20 +0200 )edit
2

answered 2020-01-28 05:57:01 +0200

teleshoes gravatar image

i added a property, Custom-Launcher=yes, that i much prefer, that skips the placeholder launcher thing: https://gist.github.com/teleshoes/f6051ca6f0ad77977f25d7019e2d43af

edit flag offensive delete publish link more

Question tools

Follow
7 followers

Stats

Asked: 2018-11-18 20:09:16 +0200

Seen: 1,320 times

Last updated: Apr 27 '20