Skip to content

Commit

Permalink
--xwin: Connect to X over TCP in (and only in) container. (#55)
Browse files Browse the repository at this point in the history
  • Loading branch information
mviereck committed Aug 2, 2018
1 parent e50eed0 commit ce0fb80
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions x11docker
Original file line number Diff line number Diff line change
Expand Up @@ -873,10 +873,17 @@ depends() { # check dependencies on host for X server option $1
[ -z "$Winsubsystem" ] && Return=1 && $Message "${1:-}: X server VcXsrv is available on MS Windows only."
[ "$Return" = "1" ] || {
export PATH="$PATH:$Vcxsrvpath"
Hostip="$(ipconfig.exe | grep 'IPv4' | head -n1 | grep -o '[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*' | grep "^10\.0\.*")"
}
;;
esac
case $Xserver in
--vcxsrv|--xwin)
Hostip="$(ipconfig.exe | grep 'IPv4' | head -n1 | grep -o '[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*' | grep "^10\.0\.*")"
[ "$Hostip" ] || {
warning "Failed to get host IP for $Xserver."
Return=1
} ;;
esac
case ${1:-} in
--weston|--xpra-xwayland|--weston-xwayland|--xdummy-xwayland)
command -v "weston" >/dev/null || {
Expand Down Expand Up @@ -2122,15 +2129,18 @@ $(cowsay "$Wisdom" 2>/dev/null || echo "Wanda the fish says: $Wisdom")"

depends $Xserver || {
case $Winsubsystem in
"") error "Did not find a possibility to provide a display.
"") error "Did not find a possibility to provide a display.
Recommendations:
To run within an already running X server, install one or all of:
Xephyr xpra nxagent
To run with GPU acceleration, install:
weston and Xwayland, optionally also: xpra and xdotool
To run from TTY or within Wayland, install:
weston and Xwayland" ;;
*) error "Did not find a possibility to provide a display.
CYGWIN) error "Did not find a possibility to provide a display.
Please install Xwin (xinit package) in Cygwin,
or VcXsrv on Windows host." ;;
MSYS2|WSL) error "Did not find a possibility to provide a display.
Please install X server VcXsrv on Windows host." ;;
esac
}
Expand Down Expand Up @@ -3869,6 +3879,8 @@ esac
--vcxsrv|--xwin)
[ "$Xserver" = "--vcxsrv" ] && Xcommand="$(escapestring "$Vcxsrvpath")/vcxsrv.exe :$Newdisplaynumber"
[ "$Xserver" = "--xwin" ] && Xcommand="$(command -v Xwin) :$Newdisplaynumber"
[ "$Xserver" = "--xwin" ] && Customenvironment="DISPLAY=$Hostip:$Newdisplaynumber
$Customenvironment"

Xcommand="$Xcommand \\
$Xserveroptions \\
Expand Down Expand Up @@ -4985,7 +4997,6 @@ DefaultEnvironment=DISPLAY=$Newdisplay XAUTHORITY=$Cshare/Xclientcookie $(IFS=$'
echo "ls -l /X$Newdisplaynumber"
echo "ls -l $Newxsocket"
}
[ "$Xserver" = "--xwin" ] && echo "note \"shared X unix socket: \$(ls -l /X$Newdisplaynumber)\""
echo ""
[ "$Hostlocaltime" ] && {
Expand Down

0 comments on commit ce0fb80

Please sign in to comment.