Flatpak¶
desktop-entry-lib can be fully used inside a Flatpak container. If you just want read/write Desktop Entries, there's nothing you need to do.
Starting Programs¶
If you want to start a Program on the host, you need the --talk-name=org.freedesktop.Flatpak
Permission. When you have this Permission, you can execute a Program on the Host with:
entry = desktop_entry_lib.DesktopEntry.from_file("my_app.desktop")
command = entry.get_command()
subprocess.run(["flatpak-spawn", "--host"] + command, cwd=entry.get_working_directory())
If you want to open a File, please note that the Paths you have inside your Flatpak may differ from the Paths on your Host.