Skip to content
This repository was archived by the owner on May 10, 2023. It is now read-only.

Commit 629df32

Browse files
committed
Updated readme.
1 parent 3378cdd commit 629df32

File tree

1 file changed

+47
-13
lines changed

1 file changed

+47
-13
lines changed

README.md

Lines changed: 47 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,9 @@ Quickly run a WSL/Linux command from a Windows (e.g., PowerShell or CMD) prompt.
44
[![ko-fi](https://www.ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/I3I1VA18)
55

66
## Introduction
7-
This is essentially a variant of [RunInBash](https://github.com/neosmart/RunInBash) designed to run Linux commands under WSL
8-
inside the bottle created by _genie_ (see https://github.com/arkane-systems/genie) if you aren't familiar with
9-
genie, which permits the use of _systemd_ and its services under WSL.
7+
This is essentially a variant of [RunInBash](https://github.com/neosmart/RunInBash) designed to run Linux commands under WSL inside the bottle created by _genie_ (see https://github.com/arkane-systems/genie) if you aren't familiar with genie, which permits the use of _systemd_ and its services under WSL.
108

11-
RunInGenie runs the supplied command using _genie -c_, feeding back stdout and stderr, and passing the return
12-
code back to the caller, for your convenience in building hybrid Windows/Linux scripts.
9+
RunInGenie runs the supplied command using _genie -c_, feeding back stdout and stderr, and passing the return code back to the caller, for your convenience in building hybrid Windows/Linux scripts.
1310

1411
Simply prefix the Linux command with the dollar sign ($):
1512

@@ -29,26 +26,63 @@ Note that by default pipes (|), etc., will be interpreted by PowerShell, so:
2926
$ ls -la 'C:\Program Files' | clip
3027
```
3128

32-
Will send the directory listing to the _Windows_ clip.exe. If you wish to pipe within WSL, you must escape it
33-
with a backtick (`), thus:
29+
Will send the directory listing to the _Windows_ clip.exe. If you wish to pipe within WSL, you must escape it with a backtick (`), thus:
3430

3531
```
3632
$ ls -la 'C:\Program Files' `| less
3733
```
3834

39-
## Installation
35+
### Shell
4036

41-
Grab the latest RunInGenie.zip from the Releases page, unzip it, and put the resulting $.exe somewhere on your PATH. Easy!
37+
Using RunInGenie without specifying a command:
38+
39+
```
40+
$
41+
```
42+
43+
Opens a shell in the current directory, useful for entering multiple commands in sequence without returning to Windows.
44+
45+
Please note that this _is not_ a login shell, and as such, for example, does not execute your login profile; `$` should not be used as a substitute for `wsl genie -s` to start a dedicated WSL shell. It's intended as a convenience for "I need a quick shell here" situations.
46+
47+
### Distro selection
48+
49+
Normally, RunInGenie executes Linux commands in the default WSL distribution (but see _Configuration_, below). This can be overriden by using the -d/--distro option, which must be the first thing specified after the `$`, and takes the distro name as shown by `wsl -l`, thus:
50+
51+
```
52+
$ -d alpine cat /etc/os-release
53+
NAME="Alpine Linux"
54+
ID=alpine
55+
VERSION_ID=3.11.3
56+
PRETTY_NAME="Alpine Linux v3.11"
57+
HOME_URL="https://alpinelinux.org/"
58+
BUG_REPORT_URL="https://bugs.alpinelinux.org/"
59+
```
4260

43-
This assumes, of course, that you already have genie installed and running correctly. If not, it won't work.
44-
genie 1.32 or higher is recommended, as earlier versions of genie had issues with arguments containing spaces.
45-
If `$ ls -la 'C:\Program Files\'` produces an error complaining that _ls_ can't find _/mnt/c/Program_, you need
46-
to upgrade your genie installation.
61+
Obviously, any distribution chosen by -d/--distro must have genie installed, or the command will fail.
4762

4863
## Examples
4964

5065
<img src="runingenie.png" alt="example screenshot" />
5166

67+
## Installation
68+
69+
Grab the latest RunInGenie.zip from the Releases page, unzip it, and put the resulting $.exe somewhere on your PATH. Easy!
70+
71+
This assumes, of course, that you already have genie installed and running correctly. If not, it won't work. genie 1.32 or higher is recommended, as earlier versions of genie had issues with arguments containing spaces. If `$ ls -la 'C:\Program Files\'` produces an error complaining that _ls_ can't find _/mnt/c/Program_, you need to upgrade your genie installation.
72+
73+
## Configuration
74+
75+
By default, RunInGenie uses the `sh` shell to execute commands (or to start when executed without parameters), and executes those commands in the WSL default distribution. These can be overridden by creating the JSON file `$.json` in the same directory as the `$.exe` executable, in the following format:
76+
77+
```
78+
{
79+
"shell": "zsh",
80+
"distro": "debian"
81+
}
82+
```
83+
84+
Either or both options can be specified to change the defaults.
85+
5286
## Bugs
5387

5488
Yes, there almost certainly are. Quoting is complicated.

0 commit comments

Comments
 (0)