Starting another apps

Hi, I am the maintainer of the liferea snap

I found some days ago that liferea uses external programs to download files like podcasts. By default it has a list of several know programs (gwet, transmission, etc).

I have transmission-gtk installed but liferea can’t see it. I presume it is for the confinement.

Is there a way to start other programs? I know I can include them on the snap, but it feels wrong to include transmission inside liferea

Should I ask for classic confinement?

Thanks

Hi @alejandro.vera, it depends on the actual use case. For .torrent files I would suggest that you save the file in a temporary location and xdg-open it. IIUC what liferea would like to do is to control where the file is stored? You would lack that option, unless it would instead interact with the Transmission REST API instead - but that’s only there if Transmission is running. And then, if Liferea wanted to access those files, they’d need to go into a shared location (~/Downloads come to mind).

For plain HTTP URLs you could also do the same, although including wget is probably the better option here.

Generally it’s best to avoid thinking “liferea starts transmission”, simply because you can’t cater for every single application that could handle that operation - and which may be the user’s preference. There’s a balance of usability vs. security that has to be struck here.

As part of snapd’s security system, each snap is isolated from the rest of the system in a sandbox. This is why you can’t see other applications.

The main method allowed to start other applications is the /usr/bin/xdg-open program provided within the sandbox. This provides the same interface you’d be used to, but is implemented as a small proxy that asks a service outside the sandbox to open the associated application. Some things to keep in mind though:

  1. If you pass it an http://... URL, it will probably just open the user’s web browser. If you want file type specific behaviour, you’ll probably have to download the file yourself and then call xdg-open on it.
  2. With the current version of snapd, there are restrictions on what other URI schemes are supported. If you try to open a magnet: URI, it will return an error rather than launching Transmission. These restrictions will be relaxed a bit when snapd 2.45 is released, provided you have xdg-desktop-portal installed.

Thanks @Saviq and @jamesh

Yes… sadly I knew those facts but I asked anyway. Maybe there was something new I didn’t know.

I know that using specific apps is not a clean way to open thins, but liferea has this apps hardcoded in the config interface (see screenshot) to download and some apps for opening. I wanted those to open if possible because it does not require changes to interface.

I am trying to solve this bug https://github.com/lwindolf/liferea/issues/825

The problem is that I am the maintainer of the package, not the developer. Using xdg to open thisn would need changes to liferea’s code

In latest versions you can use a custom command to download, but it requires people configure the app to work. It is not a out-of-the-box woring experience.

I will talk to mainstream. Maybe they can add an option to compile and use xdg-open instead of the enclosures config tab.

0