I am also struggling to set "de" as the keyboard layout on ubuntu core. I am using ubuntu-frame along with chromium kiosk for my ui. In your example, I would recommend building your own snap, which serves as a wrapper script that runs the firefox browser. With the flags daemon set to simple and restart-always set inside your snapcaft.yaml file, it should at least come up again after the user closed it.