Currently disabling autostart for an app like mail via startup settings gets reverted every time the app is launched again because the app then asks for autostart permission again and the autostart file is entirely overwritten. To disable it one would have to revoke the flatpak permission which currently can't be done graphically without third party tools. Also this wouldn't work for non flatpak applications.
With this PR we check whether an autostart file already exists and if so we check whether it has the hidden key and add it to the new autostart file. We still overwrite it completely to avoid keeping other keys we might not want (I'm not 100% sure whether that's really necessary but it seems the most save way)
Currently disabling autostart for an app like mail via startup settings gets reverted every time the app is launched again because the app then asks for autostart permission again and the autostart file is entirely overwritten. To disable it one would have to revoke the flatpak permission which currently can't be done graphically without third party tools. Also this wouldn't work for non flatpak applications. With this PR we check whether an autostart file already exists and if so we check whether it has the hidden key and add it to the new autostart file. We still overwrite it completely to avoid keeping other keys we might not want (I'm not 100% sure whether that's really necessary but it seems the most save way)