Compare commits
No commits in common. "43edc934eca92a97876fdfe386dce415b04075c3" and "480620e192974b4c12f1e912f74881212d5d2cb6" have entirely different histories.
43edc934ec
...
480620e192
3 changed files with 3 additions and 50 deletions
|
@ -5,7 +5,7 @@ These are tools I use to use Windows primarily through WSL.
|
||||||
|
|
||||||
## `mkwin`
|
## `mkwin`
|
||||||
|
|
||||||
A Linux utility to quickly make a bash script to run a Windows executable with
|
A Linux utility to quickly make a bash script to run a windows executable with
|
||||||
certain parameters.
|
certain parameters.
|
||||||
|
|
||||||
## `path-convert`
|
## `path-convert`
|
||||||
|
@ -20,10 +20,3 @@ their normal DOS form.
|
||||||
|
|
||||||
A DOS clone of `ls` that hides Windows hidden files.
|
A DOS clone of `ls` that hides Windows hidden files.
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Scripts
|
|
||||||
|
|
||||||
- `elevate.sh`: Elevate WSL (`-l`) or Windows (`-w`) commands from WSL.
|
|
||||||
- `explorer.sh`: Launch explorer from WSL.
|
|
||||||
|
|
||||||
|
|
|
@ -1,41 +0,0 @@
|
||||||
#!/usr/bin/bash
|
|
||||||
|
|
||||||
# error if 'pwsh' not in path
|
|
||||||
if [ ! which pwsh > /dev/null 2>&1 ]; then
|
|
||||||
echo "no 'pwsh' in \$PATH"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# set mode (linux/dos)
|
|
||||||
if [[ "$1" == "-l" ]]; then
|
|
||||||
mode='linux'
|
|
||||||
shift
|
|
||||||
elif [[ "$1" == "-w" ]]; then
|
|
||||||
mode='dos'
|
|
||||||
shift
|
|
||||||
fi
|
|
||||||
|
|
||||||
# error if no target
|
|
||||||
if [ "$#" -eq 0 ]; then
|
|
||||||
echo "elevate: no target"
|
|
||||||
exit 3
|
|
||||||
fi
|
|
||||||
|
|
||||||
# consume target based on mode
|
|
||||||
if [[ "$mode" == "linux" ]]; then
|
|
||||||
target='wsl.exe'
|
|
||||||
elif [[ "$mode" == "dos" ]]; then
|
|
||||||
target="$1"
|
|
||||||
shift
|
|
||||||
else
|
|
||||||
echo "elevate: no mode set; use '-l' or '-w'"
|
|
||||||
exit 2
|
|
||||||
fi
|
|
||||||
|
|
||||||
arglist=''
|
|
||||||
if [ "$#" -ne 0 ]; then
|
|
||||||
arglist="-ArgumentList '$@'"
|
|
||||||
fi
|
|
||||||
|
|
||||||
pwsh -C "Start-Process -Verb runas $target $arglist"
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
#!/usr/bin/bash
|
#!/usr/bin/bash
|
||||||
# generated with: mkwin /mnt/c/Windows/explorer.exe --pc=s
|
|
||||||
|
|
||||||
|
# launch explorer with converted path(s)
|
||||||
'/mnt/c/Windows/explorer.exe' `path-convert -s $@`
|
'/mnt/c/Windows/explorer.exe' `path-convert -s $@`
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue