commit 9f35c36ad3bd453a4c91a979f40912fd723073cc Author: Fernando Schauenburg Date: Fri Jan 21 11:49:17 2022 +0100 Initial commit - add basic utilities diff --git a/README.md b/README.md new file mode 100644 index 0000000..cbc2815 --- /dev/null +++ b/README.md @@ -0,0 +1,14 @@ +# WSL Helpers + +These are small scripts to help with living in the WSL on Windows. Mostly +wrappers to easily run Windows executables without having to hunt down the full +path to the binaries. + +# Scripts + +- `explorer`: open current directory in Windows Explorer +- `ipfonfig`: use Windows' `ipconfig` command, WSL does not provide or support + `ifconfig` (kind of redundant because we can use `ip` in the WSL but keeping + it here anyway for convenience) +- `wsl`: use the WSL to WSL the WSL. + diff --git a/bin/explorer b/bin/explorer new file mode 100644 index 0000000..e38b0b8 --- /dev/null +++ b/bin/explorer @@ -0,0 +1,7 @@ +#!/bin/sh +/mnt/c/Windows/explorer.exe "$(wslpath -w "$@")" + +# The Windows Explorer binary seems to always return 1, even though it +# succesully opens the desired folder. So, executing `true` here is just a +# hack so that we have a nice return code from our script. +true diff --git a/bin/ipconfig b/bin/ipconfig new file mode 100644 index 0000000..ad02ebb --- /dev/null +++ b/bin/ipconfig @@ -0,0 +1,3 @@ +#!/bin/sh +exec /mnt/c/Windows/System32/ipconfig.exe "$@" + diff --git a/bin/wsl b/bin/wsl new file mode 100644 index 0000000..42457b3 --- /dev/null +++ b/bin/wsl @@ -0,0 +1,3 @@ +#!/bin/sh +exec /mnt/c/Windows/System32/wsl.exe "$@" +