Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does a program communicate with the X11 Server on Linux?

So I made quite a lot of research about this and couldn't find the answer.

Does it use a named pipe ? a socket on localhost ? d-bus ?

Can I intercept and see the binary messages sent by an X client to the X server with a line of bash ?

Of course this is only for educational purpose. I don't intend to build a software that would intercept such messages.

like image 758
Emmanuel Meric de Bellefon Avatar asked Feb 17 '26 15:02

Emmanuel Meric de Bellefon


1 Answers

It uses a Unix domain socket, of the name /tmp/.X11-unix/X${DISPLAYNUMBER}. These days Linux support a special naming for Unix domain sockets, called "abstract namespace UDS", where the path is prepended with an @, but is otherwise the same.

like image 133
datenwolf Avatar answered Feb 19 '26 06:02

datenwolf



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!