rewritten from sudofox/shell-mommy
nushell script that provides a mommy function which offers praise and encouragement depending on the exit code of the command passed to it
the default prefix sets the color to a light pink but you can change it to any other prefix
i am not responsible for any damage to your mental health
to use the mommy function you can source this script in nushell or add it to the config file
the mommy function can be configured via mommy_config.json in the same directory which is created automatically if it does not exist
"color": sets the ansi color code of the text output bymommy(default: light pink)"roles": sets the roles by whichmommywill refer to itself (default:"mommy")"pronouns": sets the pronouns by whichmommywill refer to itself (default:"her")"affectionate_terms": sets the affectionate_termsmommywill use to refer to the user (default:"kitten")"emoji": sets the emojimommywill use in responses (default: ❤️)"only_negative": if set to true, will not provide praise on a non-zero exit code"negative_responses"/"positive_responses": sets the possible responses ofmommy
you can put ansi codes in every string option in the config
to add multiple possible values, you can separate them with forward slashes:
{
"affectionate_terms": "kitten/child/girl",
...
}~> mommy 123
123
mommy thinks her little kitten earned a big hug~ ❤️
~> mommy 123
123
that's a good girl~ ❤️
~> mommy 123
123
awe, what a good child~
mommy knew you could do it~ ❤️when configuring responses, you can use placeholders which will be replaced by configured values:
"{role} knows {pronoun} little {affectionate_term} can do better~ {emoji}"will be printed as
mommy knows her little kitten can to better~ ❤️to use the mommy function, just pass a command as an argument and mommy will provide a response based on the exit code of the command
mommy pwd
# output: you did an amazing job, my dear~ ❤️
mommy asdfhjkl
# output: Don't worry, mommy is here to help you~ ❤️you can make the function run automatically after every command by setting it as a pre_prompt hook:
$env.config.hooks.pre_prompt ++= [{ mommy }]
pwd
# output: mommy is so proud of you~ ❤️any command part in quotes ("like" "this") will be interpreted as if it was not quoted
to work around that, wrap it in quotes again (""like"" ""this"")
in case that doesn't work, wrap it in a raw string (r#'"like"'# r#'"this"'#)
# set custom affectionate_terms and pronouns
open mommy_config.json
| upsert affectionate_terms "kid/child/kitten"
| upsert pronouns "her/their"
| save mommy_config.json -f
# use the `mommy` function to run a command
mommy pwd
# output:
# mommy loves seeing their little child succeed~ ❤️