sharplispers / clx

a fork of crhodes' fork of danb's fork of the CLX library, an X11 client for Common Lisp
Other
116 stars 46 forks source link

Support XAUTHLOCALHOSTNAME environment variable #194

Closed massimo-zaniboni closed 2 years ago

massimo-zaniboni commented 2 years ago

Hi, in OpenSUSE Leap using Distrobox (a tool similar to Toolbox of Fedora), CLX cannot connect to the X server, because the XAUTHORITY file still uses the original "dok" host name, but under Distrobox the host is renamed to something like "dok.dev", where "dev" is the name of the Distrobox container.

If I use the content of XAUTHLOCALHOSTNAME, (when present), it is all ok.

$> env | ag X
XDG_CONFIG_DIRS=/home/zanibonim/.config/kdedefaults:/etc/xdg
XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session1
DISTROBOX_ENTER_PATH=/usr/bin/distrobox-enter
XCURSOR_SIZE=24
XDG_SEAT=seat0
XDG_SESSION_DESKTOP=KDE
XDG_SESSION_TYPE=x11
XAUTHORITY=/run/user/1000/xauth_FMoQkx
XDG_CURRENT_DESKTOP=KDE
XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0
XSESSION_IS_UP=yes
XDG_SESSION_CLASS=user
XAUTHLOCALHOSTNAME=dok
XDG_VTNR=7
XDG_SESSION_ID=3
XDG_RUNTIME_DIR=/run/user/1000
XCURSOR_THEME=breeze_cursors
XDG_DATA_DIRS=/home/zanibonim/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share

$> env | ag host
HOSTNAME=dev.dok
HOST=dev.dok
XAUTHLOCALHOSTNAME=dok
HOSTTYPE=x86_64
zanibonim@dev:~> 
dkochmanski commented 2 years ago

lgtm, thanks!