sidorares/node-x11

Add support for abstract namespace sockets

EchoAbstract opened this issue · 1 comments

By default xorg opens '/tmp/.X11-unix/X«display number»' as both an abstract namespace and a filesystem based domain socket. If you're running in a snap container you're able to access the abstract namespace socket but not the filesystem socket. (Abstract namespace domain sockets show up as @''/tmp/.X11-unix/X«display number»', but effectively just have a null byte as the first character in the sun_path field, see http://man7.org/linux/man-pages/man7/unix.7.html).

It'd be nice to have node-x11 support the abstract namespace versions of the x11 socket.

There's an NPM module, abstract-socket, that might be useful.

should be easy, I already use it in dbus client - https://github.com/sidorares/dbus-native/blob/7ddc7ebd0b6b988177733a8ac4b2f0aeff70cc73/index.js#L43-L46

Since you already have something to test against - maybe you could try to add abstract-socket support?
Domain socket connection is established here -

node-x11/lib/xcore.js

Lines 642 to 644 in 97a582b

if (socketPath) {
stream = net.createConnection(socketPath);
} else {