Skip to content

Commit

Permalink
Smaller improvements - speedup
Browse files Browse the repository at this point in the history
  • Loading branch information
root authored and root committed Dec 25, 2022
1 parent 101528b commit 844b32d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions runx
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ getwslpath() { # Get path to currently running WSL system
# Mark our filesystem with a temporary file having an unique name.
touch "${RUN_ID}"

powershell.exe -Command '(Get-ChildItem HKCU:\Software\Microsoft\Windows\CurrentVersion\Lxss | ForEach-Object {Get-ItemProperty $_.PSPath}).BasePath.replace(":", "").replace("\", "/")' | while IFS= read -r BASEPATH; do
powershell.exe -Command '(Get-ChildItem HKCU:\Software\Microsoft\Windows\CurrentVersion\Lxss | ForEach-Object {Get-ItemProperty $_.PSPath}).BasePath | where-object {$_ -ne $null} | ForEach-Object { $_.replace(":", "").replace("\", "/") }' | while IFS= read -r BASEPATH; do
# Remove trailing whitespaces.
BASEPATH="${BASEPATH%"${BASEPATH##*[![:space:]]}"}"
# Build the path on WSL.
Expand Down Expand Up @@ -287,7 +287,7 @@ check_display() { # Find unused display number
return 1
}
check_displayport() { # Return 0 if display number $1 is in use
(</dev/tcp/"$Hostip"/$((6000+${1:-})) ) >/dev/null 2>&1
timeout 1 bash -c "</dev/tcp/"$Hostip"/$((6000+${1:-})) >/dev/null 2>&1" && return 0 || return 1
}
check_host() { # Check host environment
# Check for MS Windows subsystem
Expand Down Expand Up @@ -351,7 +351,7 @@ check_xserver() { # Check for Xwin and VcXsrv
Vcxsrvbin="$(command -v vcxsrv.exe)"
[ "$Vcxsrvbin" ] || Vcxsrvbin="$(command -v "$(convertpath subsystem "C:/Program Files/VcXsrv/vcxsrv.exe")")"
[ "$Vcxsrvbin" ] || Vcxsrvbin="$(command -v "$(convertpath subsystem "C:/Program Files/VcXsrv (x86)/vcxsrv.exe")")"
Xwinbin="$(command -v XWin)"
Xwinbin="$(command -v XWin)" || Xwinbin="$(command -v XWin.exe)"
[ -z "$Xwinbin" ] && case $Winsubsystem in
WSL1|WSL2)
# search for XWin
Expand Down

0 comments on commit 844b32d

Please sign in to comment.