1
2
3
4
5
6
7
8
9
#!/bin/sh
set -x
for sock in /tmp/.X11-unix/X*; do
	if test -e "/run/Xauthority.${sock##*/X}"; then
		env XAUTHORITY="/run/Xauthority.${sock##*/X}" DISPLAY=":${sock##*/X}" "$@"
	else
		DISPLAY=":${sock##*/X}" "$@"
	fi
done