Autostart not working in Flatpak
Created by: gasinvein
Describe the problem or limitation you are having
This was an expected limitation, so I'm reporting it as an enhancement request.
Crow Translate copies the .desktop file to ~/.config/autostart
directory in order to enable autostart on Linux. But since flatpak apps are sandboxed, they can't write to that directory on the host.
Describe the solution you'd like
Flatpak relies on so-called portals, a set of DBus APIs that allow sandboxed apps to securely interact with the host OS environment. Specifically for autostart, there is the Backgound portal, which allows apps to request to enable autostart for them. Crow Translate could make use of this portal when running in Flatpak sandbox.
Describe alternatives you've considered
The only alternative would be allowing the flatpak build to access ~/.config/autostart
, but not only it would mean a trivial sandbox escape, the app would also need to take into account that it's running in flatpak, since the Exec=
property needs to be different (the portal handles it automatically).