Skip to content

Commit

Permalink
avoid Xauthbin=convertpath() #7
Browse files Browse the repository at this point in the history
  • Loading branch information
mviereck committed Aug 18, 2022
1 parent ea42a56 commit 46111d9
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 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.17"
Version="v0.4.18"

usage() { # Usage information (--help)
echo "runx - Run Linux GUI applications on MS Windows.
Expand Down Expand Up @@ -517,14 +517,13 @@ $(escapestring "$Xauthbin") \"$@\"
"

[ -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)
"$Xauthbin" -i -f "$(convertpath $Xauthsystem "$Xcookie")" add :$Newdisplaynumber . $(mcookie)
# prepare cookie with localhost identification disabled by ffff. ffff means 'familiy wild'
Cookie="$($Xauthbin -i -f "$(convertpath $Xauthsystem "$Xcookie")" nlist | sed -e 's/^..../ffff/')"
printf "$Cookie" | $Xauthbin -i -f "$(convertpath $Xauthsystem "$Xcookie")" nmerge -
verbose "Cookie: $($Xauthbin -v -f "$(convertpath $Xauthsystem "$Xcookie")" list)"
Cookie="$("$Xauthbin" -i -f "$(convertpath $Xauthsystem "$Xcookie")" nlist | sed -e 's/^..../ffff/')"
printf "$Cookie" | "$Xauthbin" -i -f "$(convertpath $Xauthsystem "$Xcookie")" nmerge -
verbose "Cookie: $("$Xauthbin" -v -f "$(convertpath $Xauthsystem "$Xcookie")" list)"
} || {
note "Command xauth not found.
runx will try experimental code to bake an X cookie itself.
Expand Down

0 comments on commit 46111d9

Please sign in to comment.