winure/man/mkwin.1

72 lines
2.3 KiB
Groff
Raw Normal View History

.Dd $Mdocdate$
.Dt MKWIN 1
2024-08-19 09:33:11 -04:00
.Os WSL
.Sh NAME
.Nm mkwin
.Nd generate bash scripts for running Windows programs from WSL
.Sh SYNOPSIS
.Nm mkwin
2024-07-22 13:37:57 -04:00
.Op Fl heEq
.Op Fl -find Ar root
.Op Fl -pc Ar flags
.Ar target
2024-08-12 15:06:09 -04:00
.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
2024-07-05 14:25:56 -04:00
The resulting script will forward the provided arguments.
2024-07-22 13:37:57 -04:00
.It Fl e , Fl -empty
The resulting script will not pass arguments to the target binary.
2024-07-22 13:37:57 -04:00
.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.
2024-08-12 15:06:09 -04:00
.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
2024-08-19 15:09:46 -04:00
.Dl $ mkwin --empty --find='/mnt/c/Program Files/WindowsApps/Microsoft.WindowsTerminal*' WindowsTerminal.exe > wt.sh
.Pp
2024-08-19 15:09:46 -04:00
PowerShell has two versions (Core is user-installed) and doesn't inherit environment variables from WSL. To generate a script to call PowerShell Core with a fallback to Windows PowerShell and shared environment variables:
2024-07-22 13:37:57 -04:00
.Pp
2024-08-19 15:09:46 -04:00
.Dl $ mkwin -E '/mnt/c/Program Files/PowerShell/7/pwsh.exe' --or '/mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe'
2024-07-22 13:37:57 -04:00
.Pp
.Sh SEE ALSO
2024-07-22 13:37:57 -04:00
.Xr env-share 1 ,
.Xr find 1 ,
.Xr path-convert 1
.Sh AUTHORS
.An -nosplit
.An Valerie Wolfe Aq Mt sleeplessval@gmail.com .