From 9f35c36ad3bd453a4c91a979f40912fd723073cc Mon Sep 17 00:00:00 2001 From: Fernando Schauenburg Date: Fri, 21 Jan 2022 11:49:17 +0100 Subject: [PATCH] Initial commit - add basic utilities --- README.md | 14 ++++++++++++++ bin/explorer | 7 +++++++ bin/ipconfig | 3 +++ bin/wsl | 3 +++ 4 files changed, 27 insertions(+) create mode 100644 README.md create mode 100644 bin/explorer create mode 100644 bin/ipconfig create mode 100644 bin/wsl 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 "$@" +