The problem I have is that I have to plasmashell --replace in order to change the layouts. I ‘m not actually a flatpak developer and I was wondering if you have any tips on how to make it work on flatpak.
First, you should check if the replace command is available over DBus. You already set permissions in your manifest to talk to the org.kde.plasmashell DBus. So if this bus provides the functionality, calling it over DBus would be the ideal way to go.
If you need to run a process on the host from the sandbox, you would need to use flatpak-spawn and the appropriate permission.
But since this basically offers a very big and wide backdoor in the sandbox, you should really try to avoid using this.
There are a few permissions there which would open up some questions:
Why do you need write access to home and read access to host? If you need access to certain folders and can’t use the FileChooser portal, you should only ask permission for the folders you actually need.
Instead of using --persist=.config, ideally your application should use the XDG Base Directory Specification, in this case reading the config path from XDG_CONFIG_HOME.
--env=PATH=/usr/bin:/bin:/app/bin doesnt make sense inside Flatpak. Runtime and App directory should already be in PATH without it, and /bin doesn’t exists.