Accessing /tmp/.X11-unix/*

You can use the layouts feature to make some changes to the mount namespace your application runs in. I’m not sure whether it would let you bind /tmp/.X11-unix back in though.

Connecting to X by TCP/IP is probably possible via the network interface, but on many systems these days the X server is configured to only listen on UNIX domain sockets (with people relying on ssh for remote connection).

You might be able to do more with a new interface, but it isn’t clear it would be accepted into upstream: there are good reasons for only exposing the abstract namespace sockets. And it would probably be easier to patch node-x11: you’d need to ship a copy of it with your snap anyway, so it wouldn’t be that difficult to ship your own branch of the module. It also seems like a change they might be willing to accept upstream, so you wouldn’t necessarily be stuck with the maintenance burden forever.

2 Likes