2023-02-28 21:49:27 +00:00
|
|
|
# ❤️ a-better-shell-mommy
|
|
|
|
Simple [shell-mommy](https://github.com/sudofox/shell-mommy) script that works on zsh as well as bash.<br>
|
2023-02-28 21:47:35 +00:00
|
|
|
|
|
|
|
## Usage
|
2023-02-28 21:49:27 +00:00
|
|
|
Instead of running `mommy command`, this script just generates responses.
|
2023-02-28 21:47:35 +00:00
|
|
|
- Positive responses: `./shell-mommy.sh -p`
|
|
|
|
- Negative responses: `./shell-mommy.sh -n`
|
|
|
|
|
|
|
|
## Env vars
|
2023-02-28 21:49:27 +00:00
|
|
|
- `$MOMMYS_LITTLE` - what *you* will be called [default: `"girl"`]
|
|
|
|
- `$MOMMYS_ROLE` - what the *mommy* will be called [default: `"mommy"`]
|
|
|
|
- `$MOMMYS_PRONOUN` - what pronouns the *mommy* will use for itself [default: `"her"`]
|
|
|
|
- `$MOMMY_COLOR` - ansi escape code used at the start of the response for color [default: `'\e[38;5;217m'`]
|
2023-02-28 21:47:35 +00:00
|
|
|
|
|
|
|
## Example
|
|
|
|
**With env vars:**
|
|
|
|
```sh
|
2023-02-28 21:49:27 +00:00
|
|
|
"$MOMMYS_ROLE knows $MOMMYS_PRONOUN little $MOMMYS_LITTLE can do better~ ❤️"
|
2023-02-28 21:47:35 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
**Defaults to:**
|
2023-02-28 21:49:27 +00:00
|
|
|
```sh
|
|
|
|
"mommy knows her little girl can do better~ ❤️"
|
2023-02-28 21:47:35 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
## Add to .zshrc
|
|
|
|
**On successful commands:**
|
|
|
|
```sh
|
|
|
|
precmd() { [ $? -ne 1 ] && /path/to/shell-mommy -p }
|
|
|
|
```
|
|
|
|
|
|
|
|
**On failed commands:**
|
|
|
|
```sh
|
2023-02-28 21:49:27 +00:00
|
|
|
precmd() { [ $? -eq 0 ] && /path/to/shell-mommy -n }
|
2023-02-28 21:47:35 +00:00
|
|
|
```
|