Custom launcher (shell script): How to close cover after completion?

It’s easy to add a custom launcher to your app menu, just drop a <something>.desktop file in ~/.local/share/applications that might look like this:

[Desktop Entry]
Type=Application
Name=Un/mount Server
Exec=/home/nemo/.local/bin/server-sshfs
Icon=/home/nemo/.local/share/icons/sshfs.png

This works as desired, but I’m getting a cover tile with a spinner that does not disappear after the script has completed, it just times out after a minute or so.

How can I avoid that?

I tried from within the .desktop file - all those commented options:

#X-Nemo-Application-Type=generic
#Custom-Launcher=yes
#X-Nemo-Single-Instance=no
#"StartupNotify=false

#[X-Sailjail]
#Sandboxing=Disabled

None made any difference.

Maybe there’s some command I can add to the shell script just before it exits?

3 Likes

Piggybacking on this, would this approach work for starting multiple apps at once?
I’ve been looking for a practical way to easily start all the apps I want running/open, especially after a reboot.

There’s an app called Takeoff which does just that.

Thanks! Did not know about it. It’s mostly what I wanted, however it doesn’t seem to work on Sailfish OS 4.4.0.58, on Xperia 10 II dual sim.
I see in the description from OpenRepos and GitHub that it doesn’t support yet versions of Sailfish OS 4.0.1.45 (Koli) and later.

I am guessing that a script with an icon could also solve the problem, but didn’t find the time to try it.

Thanks for the replies.

I have been looking around, also had a look at Takeoff (which basically just starts a systemd --user service - and the reason it doesn’t work is because lipstick.service doesn’t exist anymore), but nothing seems to adress my question.

1 Like

I have the same problem, also I didn’t find a way yet to start root commands: devel-su command through a .desktop file.

qCommand can execute commands with root privileges.

It can also create a launcher for your script, but
a) it won’t work for devel-su commands and
b) it suffers the same limitations as described here.

I have this custom launcher .desktop file and cover disappears after the script is completed.

[Desktop Entry]
Type=Application
Terminal=true
Name=Scooter mode
Exec=sh “/home/nemo/.local/share/applications/runapps.sh”
Icon=icon-l-terminal

This didn’t work for me. The command wouldn’t run at all. It would work with:
sh -c “/path/to/script/script.sh”
But even then it keeps spinning until it hits a timeout.

By the way, I was able to run root commands with pkexec in my scripts instead of devel-su (it needs the security code of fingerprint for confirmation).

3 Likes

@Kuba77: your suggestion didn’t work for me either. Can you elaborate?

Curiously, Terminal=true also seems to do nothing.

I have been experimenting with running the script in a terminal; it isn’t perfect but acceptable. However, Fingerterm does not play well in this, I had to use ToeTerm, i.e.:
Exec=toeterm -e /path/to/script

@sailerx: thanks for the pkexec tip, that will come in handy evtl.!