Skip to content

Commit

Permalink
escapestring() $Xauthbin #7
Browse files Browse the repository at this point in the history
  • Loading branch information
mviereck committed Aug 17, 2022
1 parent 2c69bfa commit 64e43c0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions runx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#! /bin/bash
# runx: Provide an X server in Cygwin, MSYS2 or WSL.

Version="v0.4.15"
Version="v0.4.16"

usage() { # Usage information (--help)
echo "runx - Run Linux GUI applications on MS Windows.
Expand Down Expand Up @@ -515,13 +515,14 @@ setup_cookie() { # Generate X authentication cookie
[ -e /usr/X11R6/bin/xauth ] || {
mkdir -p /usr/X11R6/bin
echo "#! /bin/bash
$Xauthbin \"$@\"
$(escapestring "$Xauthbin") \"$@\"
" >/usr/X11R6/bin/xauth
}
;;
esac

[ -e "$Xauthbin" ] && {
Xauthbin="$(escapestring "$Xauthbin")"
grep -q "/usr/bin" <<< "$Xauthbin" && Xauthsystem="subsystem" || Xauthsystem="windows"
# generate fresh cookie
$Xauthbin -i -f "$(convertpath $Xauthsystem "$Xcookie")" add :$Newdisplaynumber . $(mcookie)
Expand Down

0 comments on commit 64e43c0

Please sign in to comment.