winure/man/mkwin.1

71 lines
2.2 KiB
Groff

.Dd $Mdocdate$
.Dt MKWIN 1
.Os WSL
.Sh NAME
.Nm mkwin
.Nd generate bash scripts for running Windows programs from WSL
.Sh SYNOPSIS
.Nm mkwin
.Op Fl heEq
.Op Fl -find Ar root
.Op Fl -pc Ar flags
.Ar target
.Op Fl -or Ar alt
.Op Ar --\ args
.Sh DESCRIPTION
The
.Nm
utility generates bash scripts for executing Windows executables from WSL, and prints them to the standard output. The options are as follows:
.Bl -tag -width Ds
.It Ar --\ args
The resulting script will forward the provided arguments.
.It Fl e , Fl -empty
The resulting script will not pass arguments to the target binary.
.It Fl E , Fl -env-share
The resulting script will call the
.Xr env-share 1
utility.
.It Fl -find Ar root
The resulting script will locate the target binary in the given directory using
.Xr find 1 .
.It Fl h , Fl -help
Print a short help message.
.It Fl -or Ar fallback
The resulting script will fall back to the provided argument if the target is not executable.
.It Fl -pc Ar flags
The resulting script will pass the arguments converted with
.Xr path-convert 1 . path-convert will be invoked with the provided flags forwarded (use 'x' to forward no flags).
.It Fl q , Fl -quiet
The resulting script will redirect output to /dev/null and send the target to the background.
.El
.Sh EXIT STATUS
.Bl -tag -width Ds
.It 1
No
.Ar target
was provided.
.It 2
Path canonicalization failed; this typically indicates the
.Ar target
points to a file or directory that does not exist.
.El
.Sh EXAMPLES
Windows Explorer does not accept paths with spaces when executed from WSL. To generate a script to launch Windows Explorer:
.Pp
.Dl $ mkwin --pc=sqq /mnt/c/Windows/System32/explorer.exe > explorer.sh
.Pp
Windows Terminal's executable moves when updated. To generate a script to launch Windows Terminal:
.Pp
.Dl $ mkwin --empty --find='/mnt/c/Program Files/WindowsApps/Microsoft.WindowsTerminal*' WindowsTerminal.exe > terminal.sh
.Pp
PowerShell doesn't inherit environment variables from WSL. To generate a script to call PowerShell with shared variables:
.Pp
.Dl $ mkwin -E '/mnt/c/Program Files/PowerShell/7/pwsh.exe'
.Pp
.Sh SEE ALSO
.Xr env-share 1 ,
.Xr find 1 ,
.Xr path-convert 1
.Sh AUTHORS
.An -nosplit
.An Valerie Wolfe Aq Mt sleeplessval@gmail.com .