Moving the X11 socket to XDG_RUNTIME_DIR
Artur Manuel
amad at atl.tools
Wed Jul 2 18:40:13 UTC 2025
Hello, hope this email comes in good faith.
I was thinking of any benefits that could arise from moving the X11
socket from /tmp/.X11-unix to $XDG_RUNTIME_DIR/.X11-unix and I thought
of a few. This thought was inspired by Wayland and their approach for
sockets, and from how I see it, it may benefit XWayland.
- Moving the X11 socket to XDG_RUNTIME_DIR makes Xorg seem as if it is
willing to adopt the XDG specification (which it already does with
Xorg logs going to ~/.local/share/Xorg), but I feel as if this change
would cement that further.
- I think that the X11 socket being so easy to access (as it is 0777,
and in /tmp) is a security flaw which shouldn't exist even in terms of
backwards compatibility. I think this can be resolved by
symlinking, but if most programs work fine without needing to symlink
then that's amazing.
- You wouldn't run into unpredictability issues regarding where the X11
socket is on many systems, as most systems now use XDG_RUNTIME_DIR. As
for Windows, they can keep %TEMP% or %TMP% or whatever it is called.
I also believe some of the Windows-specific functions could benefit
from a rewrite, so moving the socket may bring that closer.
I thought of these for a while and was thinking of where I could ask
about it to but I want to ask about it here before taking any bigger
steps. I admittedly am not the greatest fan of Xorg but I need to wait
for the Wayland situation to improve on FreeBSD before I make the
switch. It is okay now but not amazing in it's current state, while Xorg
is just good enough on here for me to use it.
I look forward to your (plural) views.
Cheers,
--
Artur Manuel (amadaluzia)
More information about the xorg-devel
mailing list