@tobias I sought some clarification and while the extract I posted “works” it isn’t good practice, nor the way things should be.
What should be happening is that snapd should be creating $XDG_RUNTIME_DIR
. But it isn’t.
Unfortunately, the client cannot use mkdir -p -m 700 $XDG_RUNTIME_DIR
to create the directory (/run/user/0/snap.mir-kiosk-apps
in the example I was trying) as there is no /run/user/0
either. UNLESS there is a server (mir-kiosk) already running (which will have created it).
A second problem is that the link command will fail unless the target exists. That also requires a server to be running.
If (and only if) there’s a server already running this works:
mkdir -p -m 700 $XDG_RUNTIME_DIR
ln -sf /run/user/0/wayland-0 $XDG_RUNTIME_DIR/
We are trying to clear this all up and provide a reliable mechanism. So, while the above advice is a pragmatic solution for now, be prepared for changes.