Giter VIP home page Giter VIP logo

mommy's Introduction

mommy 💝

github latest release mommy is on aur github ci status mommy is licensed under unlicense


🚚 installation | 📖 usage | 🙋 configuration | 🐚 shell integration | ⚗️ development | 💖 acknowledgements


mommy's here to support you! mommy will compliment you if things go well, and will encourage you if things are not going so well~

mommy is fully customizable, integrates with any shell, works on any system, and most importantly, loves you very much~ ❤️

a command-line interface showing the text 'it's okay to make mistakes' after the user has failed to enter their password correctly three times in a row

🚚 installation top ▲

mommy works on any system. mommy is tested on ubuntu, debian, archlinux, fedora, nixpkgs, macos, freebsd, netbsd, openbsd, and windows~

don't see your favourite distro or package manager listed? need help? otherwise not satisfied? please open an issue~

👩‍💼 with a package manager

find your operating system and package manager for the right instructions~

alpine linux
  • homebrew (automatic updates)
    installs from the mommy tap. (requires brew.)
    brew tap fwdekker/mommy
    brew install mommy
    after installing, check the brew documentation on how to enable shell completions~
  • apk (github release) (manual updates)
    # download latest package from github release
    curl -s https://api.github.com/repos/FWDekker/mommy/releases/latest | grep "browser_download_url.*\.apk" | cut -d : -f 2,3 | tr -d \" | xargs curl -sLOJ
    # install package
    sudo apk add --allow-untrusted ./mommy-*.apk
arch linux
  • arch user repository (automatic updates)
    installs from the arch user repository, allowing for automatic updates. you should probably use an aur helper to do this:
    # if you use yay
    yay -S mommy
    # if you use paru
    paru -S mommy
    # if you use aura
    aura -A mommy
    # and so on
  • homebrew (automatic updates)
    installs from the mommy tap. (requires brew.)
    brew tap fwdekker/mommy
    brew install mommy
    after installing, check the brew documentation on how to enable shell completions~
  • pacman (github release) (manual updates)
    # download latest package from github release
    curl -s https://api.github.com/repos/FWDekker/mommy/releases/latest | grep "browser_download_url.*\.pacman" | cut -d : -f 2,3 | tr -d \" | xargs curl -sLOJ
    # install package
    sudo pacman -U ./mommy-*.pacman
debian/ubuntu/apt-based
  • apt ≥2.2.4 (automatic updates)
    this method requires apt v2.2.4 or newer. check your version of apt with apt -v~

    installs from the mommy apt repository. the repository supports all architectures and suites~

    sudo curl -fsSo /etc/apt/sources.list.d/mommy.sources \
      https://raw.githubusercontent.com/FWDekker/apt-mommy/main/deb/mommy.sources
    
    sudo apt update
    sudo apt install mommy
  • apt <2.2.4 (automatic updates)
    this method works on all versions of apt~

    installs from the mommy apt repository. the repository supports all architectures and suites~

    check this page for details on what this code does~

    sudo mkdir -m 0755 -p /etc/apt/keyrings/
    
    curl -fsSL https://raw.githubusercontent.com/FWDekker/apt-mommy/main/deb/Release.key |
      sudo gpg --dearmor -o /etc/apt/keyrings/mommy.gpg
    
    echo "deb [signed-by=/etc/apt/keyrings/mommy.gpg] https://raw.githubusercontent.com/FWDekker/apt-mommy/main/deb/ ./" |
      sudo tee /etc/apt/sources.list.d/mommy.list > /dev/null
    
    sudo apt update
    sudo apt install mommy
  • homebrew (automatic updates)
    installs from the mommy tap. (requires brew.)

    brew tap fwdekker/mommy
    brew install mommy

    after installing, check the brew documentation on how to enable shell completions~

  • apt (github release) (manual updates)

    # download latest package from github release
    curl -s https://api.github.com/repos/FWDekker/mommy/releases/latest | grep "browser_download_url.*\.deb" | cut -d : -f 2,3 | tr -d \" | xargs curl -sLOJ
    # install package
    sudo apt install ./mommy*.deb
freebsd
  • pkg (github release) (manual updates)
    # download latest package from github release
    curl -s https://api.github.com/repos/FWDekker/mommy/releases/latest | grep "browser_download_url.*\.freebsd" | cut -d : -f 2,3 | tr -d \" | xargs curl -sLOJ
    # install package
    sudo pkg add ./mommy-*.freebsd
macos
  • homebrew (automatic updates)
    installs from the mommy tap. (requires brew.)
    brew tap fwdekker/mommy
    brew install mommy
    after installing, check the brew documentation on how to enable shell completions~
  • pkg (github release) (manual updates)
    # download latest package from github release
    curl -s https://api.github.com/repos/FWDekker/mommy/releases/latest | grep "browser_download_url.*osx\.pkg" | cut -d : -f 2,3 | tr -d \" | xargs curl -sLOJ
    # install package
    sudo installer -pkg ./mommy*+osx.pkg -target /
netbsd
  • pkg_add (github release) (manual updates)
    # download latest package from github release
    curl -s https://api.github.com/repos/FWDekker/mommy/releases/latest | grep "browser_download_url.*netbsd\.tgz" | cut -d : -f 2,3 | tr -d \" | xargs curl -sLOJ
    # install package
    sudo pkg_add ./mommy-*+netbsd.tgz
nixpkgs/nixos
  • nix-shell (temporary)
    if you're curious but not ready for commitments, use nix-shell to temporarily install mommy:

    nix-shell -p mommy
  • home-manager (persistent)
    if you use home manager, install mommy by adding the following to your home manager configuration:

    home.packages = with pkgs; [
      mommy
    ];

    you can configure mommy as follows:

    home.packages = with pkgs; [
      (mommy.override {
        mommySettings = {
          sweetie = "catgirl";
        }
      })
    ];

    check the full list of configuration options. note that your nix configuration should use lowercase variable names~

  • nixos (persistent)
    install mommy by adding the following to your nixos configuration (usually in /etc/nixos/configuration.nix):

    environment.systemPackages = with pkgs; [
      mommy
    ];

    you can configure mommy as follows:

    environment.systemPackages = with pkgs; [
      (mommy.override {
        mommySettings = {
          sweetie = "catgirl";
        }
      })
    ];

    check the full list of configuration options. note that your nix configuration should use lowercase variable names~

openbsd
  • pkg_add (github release) (manual updates)
    # download latest package from github release
    curl -s https://api.github.com/repos/FWDekker/mommy/releases/latest | grep "browser_download_url.*openbsd\.tgz" | cut -d : -f 2,3 | tr -d \" | xargs curl -sLOJ
    # install package
    sudo pkg_add -D unsigned ./mommy-*+openbsd.tgz
red hat/fedora/opensuse/rpm-based
  • dnf (copr) (automatic updates)
    installs from the copr repository. (requires the dnf-plugins-core package.)
    sudo dnf copr enable fwdekker/mommy
    sudo dnf install mommy
    packages are signed by fwdekker#[email protected], check for fingerprint E332 C8E6 ADAA 58E4 1974 7CE2 CE16 3CFF 9F79 DD8A~
  • yum (copr) (automatic updates)
    installs from the copr repository. (requires the yum-plugin-core package.)
    sudo yum copr enable fwdekker/mommy
    sudo yum install mommy
    packages are signed by fwdekker#[email protected], check for fingerprint E332 C8E6 ADAA 58E4 1974 7CE2 CE16 3CFF 9F79 DD8A~
  • homebrew (automatic updates)
    installs from the mommy tap. (requires brew.)
    brew tap fwdekker/mommy
    brew install mommy
    after installing, check the brew documentation on how to enable shell completions~
  • dnf (github release) (manual updates)
    # download latest package from github release
    curl -s https://api.github.com/repos/FWDekker/mommy/releases/latest | grep "browser_download_url.*\.rpm" | cut -d : -f 2,3 | tr -d \" | xargs curl -sLOJ
    # install package
    sudo dnf install ./mommy-*.rpm
windows

for git bash or cygwin, see the instructions for using mommy without a package manager~

  • wsl (automatic or manual updates)
    follow any of the mommy installation instructions for your installed linux subsystem (default is ubuntu) or build mommy from source~
  • msys2 (automatic or manual updates)
    follow any of the mommy installation instructions for arch linux (except do not use the arch user repository method) or build mommy from source~

🐐 without a package manager

build from source and install

if you want to customise where and how mommy installs, you can just compile her code yourself~

  1. prerequisites

  2. clone repository

    git clone https://github.com/FWDekker/mommy.git
    cd mommy
  3. install
    this step builds mommy's files and copies them into your system. the exact paths differ per system, so find the instructions that are right for your system.

    ℹ️ note
    if you want to install mommy only for the current user, add prefix='~/.local/' before install~

    💡 tip
    check the makefile for a list of all prefix variables you can override~

    • debian/ubuntu/apt-based
      sudo make install/deb
    • freebsd
      sudo gmake install/freebsd
    • macos
      sudo gmake install/osxpkg
    • netbsd
      sudo gmake install/netbsd
    • openbsd
      sudo gmake install/openbsd
    • windows
      sudo make install
    • all other unix systems
      sudo make install
  4. test (optional)
    if you want to make sure installation was successful, you can run tests using shellspec. run the following from inside the cloned mommy repository

    git clone https://github.com/shellspec/shellspec.git
    PATH="$(pwd)/shellspec/:$PATH" make system=1 test

    some tests will be skipped, depending on which other programs you have installed~

  5. uninstall (optional)
    if you want to uninstall after running make install, just run the same command as in step 3, except you replace install with uninstall.

    uninstall might not work completely if you installed a different version than the one you're uninstalling. for the best results, run mommy -v, check the version number, run git checkout <the version>, and then perform the uninstallation~

use without installing

if you don't want to use a package manager but also don't want to bother with makeing mommy, you can download a universal build of mommy, and play around with that. this will not install any files onto your system. if you're here because you want to install mommy only for a specific user, the "build from source and install" option is probably a better approach, though~

the script below downloads the latest stable release and extracts it for you. if you don't want to use curl, just check the latest release in your browser and download the file ending in +generic.tar.gz manually~

# download latest archive from github release
curl -s https://api.github.com/repos/FWDekker/mommy/releases/latest | grep "browser_download_url.*generic\.tar\.gz" | cut -d : -f 2,3 | tr -d \" | xargs curl -sLOJ
# extract archive to `mommy`
tar -C ./ -xzf mommy-*.tar.gz
# invoke mommy
./mommy/usr/bin/mommy

🔮 what's next?

check out how to use mommy, read all about ways you can configure mommy, and integrate mommy with your shell~

a command-line interface showing the text 'never give up, my love' after running a command that has failed, and showing the text 'mommy knew you could do it' after running a command that has succeeded

📖 usage top ▲

mommy processes (the output status of) a command and compliments you if the command succeeds and encourages you if it fails~

Tip

the recommended way of long-term mommy usage is to integrate mommy into your shell, so mommy will run after every command you run~

💃 how to run

for reference, here's the three main ways to invoke mommy~

format example when to use
mommy [command] ... mommy npm test if you want mommy to respond to a single command~
mommy -e [command] mommy -e "ls -l | wc -l" if you want mommy when using | or >, or need mommy in a script~
mommy -s [status] mommy -s $? if you already ran a command and want mommy's help afterwards~

🛸 extra options

additionally, mommy knows a few extra options, which you can use to discover who mommy is and to tell mommy which configuration files she should use~

short option long option description
-h --help opens mommy's manual page~
-v --version displays mommy's version information~
-1 writes output to stdout instead of stderr~
-c <file> --config=<file> tells mommy that she should read your config from <file>~
-d <dirs> --global-config-dirs=<dirs> sets global configuration dirs to the colon-separated list in <dirs>~

🙋 configuration top ▲

mommy's behavior can be modified using config files. the easiest way to do so is to add your config to the file ~/.config/mommy/config.sh. you can also set up a global config file that is applied to all users, by default in /etc/mommy/config.sh. read more about the way config files are loaded~

mommy supports a lot of different settings. if you want to configure the value of MOMMY_SWEETIE, add the following line to your config file:

MOMMY_SWEETIE="catgirl"

make sure you do not put spaces around the =, and you do put quotes (") around the value~

🔍 config file locations

when mommy runs, she will first load the system-wide global config file. after that, she will read the user-specific local config file, overriding the values from the global file~

  • to find the global config file, mommy runs the following procedure.
    1. mommy determines the list of global config dirs.
      1. if a list is specified using a command-line option, that list is used.
      2. otherwise, the list consists of all directories in $XDG_CONFIG_DIRS, plus /etc/mommy, plus /usr/local/etc/mommy/.
    2. mommy traverses this list, and stops once she finds a directory that contains the file config.sh. this file will be the global config file~
  • to find the local config file, mommy runs the following procedure.
    1. if a config file is specified using a command-line option, that file is used.
    2. if $XDG_CONFIG_HOME is defined, the file $XDG_CONFIG_HOME/mommy/config.sh is used.
    3. otherwise, $HOME/.config/mommy/config.sh is used~
👛 list of all settings
variable description list? default
MOMMY_CAREGIVER what mommy calls herself yes mommy
MOMMY_PRONOUNS mommy's pronouns for herself. should be three words separated by spaces, as in they them their (subject, object, possessive) yes she her her
MOMMY_SWEETIE what mommy calls you yes girl
MOMMY_PREFIX what mommy puts at the start of each sentence yes <empty>
MOMMY_SUFFIX what mommy puts at the end of each sentence yes ~
MOMMY_CAPITALIZE 0 to start sentences in lowercase, 1 for uppercase, anything else to change nothing no 0
MOMMY_COLOR color of mommy's text. you can use any xterm color code, or write lolcat to use lolcat (install separately). specify multiple colors separated by / to randomly select one. set to empty string for your terminal's default color yes 005
MOMMY_COMPLIMENTS default compliment templates yes <various>
MOMMY_COMPLIMENTS_EXTRA additional compliment templates you can specify yes <empty>
MOMMY_COMPLIMENTS_ENABLED 1 to enable compliments, anything else to disable no 1
MOMMY_ENCOURAGEMENTS default encouragement templates yes <various>
MOMMY_ENCOURAGEMENTS_EXTRA additional encouragement templates you can specify yes <empty>
MOMMY_ENCOURAGEMENTS_ENABLED 1 to enable encouragements, anything else to disable no 1
MOMMY_FORBIDDEN_WORDS mommy will never give outputs that match forbidden strings. each entry is expressed as an extended regex (see also man grep). to enforce this, mommy will filter out all templates that match at least one regex. as a failsafe, mommy will also check her final output after choosing and filling in the template, and will output nothing if she finds a forbidden string. also, if you want, you can replace literal characters with their octal (not hex!) escape sequences; for example, you can write \0155\0157\0155 instead of mom yes <empty>
MOMMY_IGNORED_STATUSES exit codes that mommy should never reply to. set to empty string to ignore nothing yes 130
🪣 how to configure lists

some of these settings support lists. mommy chooses a random element from each list each time she is called by you. (except for MOMMY_FORBIDDEN_WORDS and MOMMY_IGNORED_STATUSES, where mommy always considers all elements of the list.) in a list, elements are separated by a newline or by a /. elements that contain whitespace only, and elements that start with a # are ignored~

  • for example, if you set
    MOMMY_SWEETIE="girl/kitten"
    then mommy will sometimes call you girl, and sometimes kitten~
  • if you set
    MOMMY_CAREGIVER="mommy
    mummy/#daddy/caregiver"
    then mommy will call herself mommy, mummy, or caregiver, but not daddy~
  • if you set
    MOMMY_PRONOUNS="she her her/they them their"
    then mommy may choose between mommy knows she loves her girl and mommy knows they love their girl (but not mommy knows they love her girl)~
  • if you set
    MOMMY_FORBIDDEN_WORDS="cat/dog"
    then mommy will never use templates that contain cat, and will never use templates that contain dog~
🧬 how to configure templates

you can add a list of your own compliments to either MOMMY_COMPLIMENTS or MOMMY_COMPLIMENTS_EXTRA. there is a slight difference between the two lists:

  • if you want both the default and your own compliments, add your own compliments to MOMMY_COMPLIMENTS_EXTRA~
  • if you want your own compliments and not the default compliments, add your own compliments to MOMMY_COMPLIMENTS~

and similarly so for encouragements~

inside compliments and encouragements, you can put placeholders that contain the random values that mommy chose. for example, if you add the compliment %%CAREGIVER%% loves you, and have MOMMY_CAREGIVER=your mommy, then mommy outputs your mommy loves you~

variable description
%%CAREGIVER%% what mommy calls herself
%%THEY%% mommy's subject pronoun (e.g. they, she, he)
%%THEM%% mommy's object pronoun (e.g. them, her, he)
%%THEIR%% mommy's possessive pronoun (e.g. their, her, he)
%%SWEETIE%% what mommy calls you
%%N%% a newline
%%S%% a forward slash (/)

🐚 shell integration top ▲

instead of calling mommy for each command, you can fully integrate mommy with your shell to get mommy's output each time you run any command. here are some examples on how you can do that in various shells. recall that you can add MOMMY_COMPLIMENTS_ENABLED=0 to your mommy config file to disable compliments while keeping encouragements~

this is just a small list of possibilities. if you know of another way to integrate mommy, feel free to contribute them by opening a pull request!

🪅 bash

in bash you can set PROMPT_COMMAND to run mommy after each command. just add the following line to ~/.bashrc:

PROMPT_COMMAND="mommy -1 -s \$?; $PROMPT_COMMAND"
bash showing the text 'it's okay to make mistakes' after running a command that has failed
🐟 fish

in fish you can have mommy output a message on the right side of your prompt by creating ~/.config/fish/functions/fish_right_prompt.fish with the following contents:

function fish_right_prompt
    mommy -1 -s $status
end

if you have an oh my fish theme installed, check the docs of your theme to see if there's an easy way to extend the theme's right prompt. if not, you can either overwrite it with the above code, or copy-paste the theme's code into your own config file and then add mommy yourself~

fish shell showing the text 'it's okay to make mistakes' in the right prompt after running a command that has failed
📈 nushell

in nushell you can have mommy output a message on the right side of your prompt by adding the following line to your ~/.config/nushell/config.nu file:

$env.PROMPT_COMMAND_RIGHT = {|| mommy -1 -s $env.LAST_EXIT_CODE }
nushell showing the text 'just a little further, mommy knows you can do it' in the right prompt after running a command that has failed
🪟 powershell

the exact instructions depend on how and where you installed mommy~

  1. disable mommy's color output
    mommy's colors don't really work well in powershell, so you'll have to disable them~

    • wsl
      if you want to run mommy through wsl, open wsl and run
      # run this in wsl
      mkdir -p ~/.config/mommy
      echo "MOMMY_COLOR=" >> ~/.config/mommy/config.sh
    • git bash
      if you want to run mommy through git bash, run
      # run this in powershell
      [IO.Directory]::CreateDirectory("$HOME/.config/mommy")
      [IO.File]::WriteAllLines("$HOME/.config/mommy/config.sh", "MOMMY_COLOR=''")
  2. test prompt
    change powershell's prompt to include mommy's message~

    • wsl
      if you want to run mommy through wsl, run
      # run this in powershell
      function prompt { "$(wsl -e mommy -1 -s $([int][bool]::Parse(!$?)))> " }
    • git bash
      if you want to run mommy through git bash, and you downloaded mommy to C:\Users\username\mommy, run
      # run this in powershell
      function prompt { "$(& "C:\Program Files\Git\bin\sh.exe" "C:/Users/username/mommy" -1 -s $([int][bool]::Parse(!$?)))> " }
  3. save prompt
    now let's make this prompt persistent. in powershell, run notepad $profile to open your powershell settings, and add the function prompt [...] line from above~

    ℹ️ note
    if you get an error that this file does not exist, run new-item -itemtype file -path $profile -force to create it~

    ℹ️ note
    if you get an error that you cannot run local scripts, run Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope LocalMachine as admin, or sign the script~

  4. improve prompt
    the instructions above show the basics of using mommy in powershell. you can make it way cooler using a theme engine like oh-my-posh. for example, you can use background colors or display mommy in the right prompt instead of the left~

💤 zsh

depending on where you want mommy's output, the instructions are a bit different. you can either get the output above your prompt, or aligned to the right~

above the prompt
to get mommy's output on a separate line above your prompt, add the following line to ~/.zshrc:

precmd() { mommy -1 -s $? }

to the right of each command
to get mommy's output on the same line as your prompt, aligned to the right, add the following to ~/.zshrc:

set -o PROMPT_SUBST
RPS1='$(mommy -1 -s $?)'  # using single quotes here is required!

and add the following to your mommy config:

MOMMY_COLOR=""
MOMMY_PREFIX="%F{005}/%F{006}"
MOMMY_SUFFIX="~%f"

normally, mommy sets colors using standard ansi color codes, but zsh's support is a bit special, resulting in zsh miscalculating the prompt width, which looks like your prompt is misaligned or shifted. to fix this, you should disable mommy's color feature and manually set colors in the prefix option. to specify colors, use zsh's special syntax, where the numbers correspond to the xterm color codes. finally, the %f in the suffix resets the colors~

zsh showing the text 'never give up, my love' in the right prompt after running a command that has failed
🐌 other shells

as a generic method, in any posix shell (including sh, ash, dash, bash) you can change the prompt itself to contain a message from mommy by setting the $PS1 variable:

PS1="\$(mommy -1 -s \$?)$PS1"

to improve the spacing, set MOMMY_SUFFIX="~ " in mommy's config file.

add the above line to the config file for your shell (e.g. .bashrc for bash) to apply it each time you open the shell. some shells (dash, pdksh) do not have a config file like .bashrc, but you can enable one by adding the following line to ~/.profile:

export ENV="$HOME/.shrc"

note that this will apply to all (non-login) posix shells that you open. after that, add the above-mentioned line that defines PS1 to ~/.shrc. log out and back in, and mommy will appear in your shell~

✍️ renaming the mommy executable

if you use any of the above integrations, you don't have to call mommy directly. if you don't want that, but also don't want to write mommy, this section explains how you can instead write, say, daddy, marija, or sinterklaas~

mommy is installed in slightly different locations on different systems, but you can easily find where mommy is installed with whereis mommy:

$ whereis mommy
mommy: /usr/bin/mommy /usr/share/man/man1/mommy.1.gz

the exact output of whereis differs depending on your system, but in this case you can see that the program is installed in /usr/bin/mommy (and the manual page in /usr/share/man/man1/mommy.1.gz). if whereis mommy doesn't work, mommy is not on your path, but you can still find her with find / -name mommy~

anyway, after finding mommy, you can just symlink using the following commands: (if whereis gave different paths than the ones above, then change these commands accordingly)

sudo ln -fs /usr/bin/mommy /usr/bin/daddy
sudo ln -fs /usr/share/man/man1/mommy.1.gz /usr/share/man/man1/daddy.1.gz

[!IMPORTANT] uninstalling mommy will not remove the manually created symlinks~

⚗️ development top ▲

this section explains how to build mommy from source, in case you want to help with development or for any other reason~

🎬 run

you can actually just directly run the script in src/main/sh/mommy. the only difference will be that the -h and -v options may not work correctly. if that annoys you, run make build after each change, and use build/bin/mommy instead~

🧪 tests
  1. requirements
    shellspec
  2. test local code
    1. all tests
      make test
    2. unit tests
      make test/unit
    3. integration tests
      make test/integration
  3. test installed code
    make system=1 test
  4. configuration
    except for system=1, test behaviour is configured with environment variables. check the various files in src/test/ to find 'em all~
🏬 distribution

mommy is distributed in three ways:

  • attached as binary packages to each github release,
  • built on build servers,
  • and available as source builds ("ports", basically) on a few servers.

let's go into them in more detail~

  • 📦 binary packages
    the binary packages attached to the github release are built with the makefile. run make list to see a list of build targets; you're looking for the ones starting with dist/~

    to build the packages, you need at least gnu make, ruby, and fpm. (actually, you don't need fpm for netbsd and openbsd.) on debian-based systems, you already have gnu make, so you only need

    sudo apt install ruby
    sudo gem install fpm

    after that, just run make dist/deb (or better: mommy make dist/deb), and a .deb package will be built in dist/. run make or make list for a list of valid build targets. a special target is install, which directly copies the files into the specified directories on your system. these directories can be changed by setting prefix variables, as in make prefix=/usr/ install. i recommend running make --dry-run prefix=/usr/ install first so you can verify that all directories are calculated correctly. check the makefile for more details~

    all systems can build packages for themselves without additional dependencies beyond those noted above. if you want to compile for a different system, you may need additional dependencies. for example, if you want to build packages for alpine linux, archlinux, and rpm from a debian-like system, you will respectively need

    sudo apt install libarchive-tools rpm zstd

    and then you can run

    make dist/apk dist/pacman dist/rpm

    unfortunately, packages for macos, netbsd, and openbsd cannot be built on systems other than themselves~

  • 🏗️ build servers
    build servers build mommy distributions on-demand for each release, and make the created packages available for all users. how sweet~

    • apt-mommy is a github-based apt repository that hosts mommy's .deb packages after they have been built in mommy's cd pipeline~
    • copr builds packages for fedora and epel~
  • 🌱 source builds
    some servers host instructions on how to build mommy, but don't do any work beyond that. users connect to the server, get the latest instructions, and their system builds mommy for them locally~

📯 release

main always contains the latest stable version. to release a new version, just use the deploy action, which can be activated using a workflow_dispatch event~

release checklists

  • before triggering deployment

    • update version~
    • update all changelogs~
      • update CHANGELOG.md~
        • do not leave a placeholder section for [unreleased], because it will end up like that in the .deb's changelog.gz~
        • remove empty subsections for the new release~
        • ensure no line breaks are used as whitespace; github release notes use them as actual line breaks~
      • update pkg/rpkg/mommy.spec.rpkg if changes were made to copr's rpkg packaging process~
      • update pkg/fpm/deb.changelog if changes were made to fpm's debian packaging process~
      • update pkg/fpm/rpm.changelog if changes were made to fpm's rpm packaging process~
    • update acknowledgements in README.md~
    • update promotional images in .github/img/~
  • after triggering deployment

💖 acknowledgements top ▲

mommy recognises all contributors, no matter the size of the contribution. if mommy should add, remove, or change anything here, open an issue or contact the author~

mommy's People

Contributors

ckiee avatar dsprenkels avatar fwdekker avatar natawie avatar zopolis4 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

mommy's Issues

MOMMY_SWEETIE not working in zsh

I added the following:

MOMMY_SWEETIE="boy"

to my .zshrc because I would like mommy to call me a boy (oh god that sounds weird). But, of course, this isn't working. Is there another way I'm supposed to do this or does this not work in zsh?

i do not have config file

i tried finding or downloading config file but i cant find it, im new to linux so i may just be stupid, but can sb tell me what can i do?

rename sh distribution

from sh to sh_installer, to clarify to the user that it's an actual installer, not just the script!

Nushell Support

I think this could be integrated into nushell using

$env.config.hooks.pre_prompt = { mommy -1 -s $env.LAST_EXIT_CODE }

I believe this is analogous to the other integrations provided in the README, but there is a problem where it gets printed even for simply hitting enter, or clearing the screen, as it is a prompt hook.

I believe there is a way to integrate this better using display_output (which allows to mutate the output of the previous command itself, or simply print it back with mommy appended to it) and command_not_found (which is run on the occasions display_output isn't, I believe) hooks, but I'm not sure how exactly that would be implemented.

read custom config using `env -i`

that's presumably a lot more secure than source-ing it because that could lead to privilege escalation when someone does sudo mommy (though obviously you should always do mommy sudo)

test installer

the installer script is now actually a feature of mommy and so it needs to be tested, also so that it can grow more complex and do stuff like having options and those need to be tested

gz docs

most others docs are like mommy.1.gz while mommy does mommy.1, so mommy should probably do the same and gz the docs in the build process

add option to start an interactive mommy session

It is usually desireable for mommy to be disabled by default, but sometimes you might like to enable it for a single session.
In these cases it might be nice to have a mommy [-i | --interactive] that starts a new shell with mommy enabled internally. The user should be able to exit that shell in the regular way, i.e., with exit.

colors

add colored text, nice :-)

link to alias by command

instead of asking the user to run commands to rename mommy to some alias, let the user run mommy -l something and mommy will do it for the user. save the name of the alias in a file somewhere (say, ~/.local/share/mommy/alias) so that there's never more than one alias.

add to fedora copr

seeing how there's already an rpm available, it probably won't be too much work + there'll be updates through dnf instead of downloading them manually

improve performance

mommy isn't very fast, and on my laptop she takes between 200 and 300 ms to generate a prompt, which is really bad, it really shouldn't be more than 50ms

add shell completions

in fish, when I write git and press tab, fish tells me what options i have. when i write mommy git and press tab, fish doesn't know what's going on!

mommy should add and install integrations for various shells:

  • bash
  • fish
  • zsh

different pronoun forms

currently, mommy only supports possessive pronouns ("their"), but not basic ones such as "they" and "them". mommy should support this by making the pronoun format from "her/their" to "she her her/they them their". just basic word splitting really

test and build packages in their own systems

currently all linux builds are produced and tested on linux. but that's not good enough. it should be built and tested in the system for which it will build (e.g. run in an archlinux vm, download the aur repo, point it to the current branch, run and test makepkg), to make sure it really works end-to-end.

add multiple presets

users can currently configure MOMMY_COMPLIMENTS and MOMMY_ENCOURAGEMENTS to change what mommy will say. users who want a stricter, tougher mommy can thus configure mommy to do so by themselves, but I anticipate there will be a few categories of behaviour that many users will want. so why not add those to the default presets?

so, add a variable MOMMY_PRESET, which determines which preset is applied:

  • if the preset is unset (or unknown), the default (current) sentences are loaded, and then the user's configured templates optionally override that
  • if a preset is set (and exists), these override the user's configured templates (but not the *_CUSTOM variables, of course), since it does not make much sense to set both MOMMY_COMPLIMENTS and MOMMY_ENCOURAGEMENTS (unless a user wants to override only one of them, and use the other from the preset?)

meta-templates

currently each compliment is a template in the sense that words are substituted into it. but it would be nice if users could also create something that wraps around each filled-in compliment (say, a multiline (cf. #58) ascii art of a cow with a speech bubble), without having to copy-paste the same prefixes and suffixes all the time! (and also, multiple prefixes and suffixes would possibly choose mismatching parts)

ci

run tests automatically

newline before output

always put a newline before mommy's compliment, so it's not too close to the previous command's output!

try out creating dmg again

i realised that macos doesn't like you putting stuff in /usr/bin, but putting it in /usr/local/bin is fine with a script. so perhaps that's also true for when you create a .dmg, that it actually works this time around

if so, I think it'd be a good idea to deprecate the custom installer script and just create separate releases; users who target any other system should just extract it to the right directories anyway, or open an issue to request a release for their system specifically (and add that to the readme!)

show off integrations

dont just say it's possible, show it! together with #29, show it off, either in the integration section or in the features section, or both. or in the gif, or in a sort of small gallery showcasing a bunch of features

describe/test wsl

does mommy work nicely with wsl (windows subsystem for linux)? try it out, maybe in ci as well, and formally add it to the readme~

improve docs

  • write down default values
  • specify how values are parsed
  • specify which configs relate to which template parameters
  • specify which configs are randomised
  • specify that the config file must be valid shell
  • make the config section step-by-step, so first explain template variables, then templates, and finally more advanced stuff; instead of throwing everything at the user at once

add option to make push to main not create release

sometimes i just want to update the docs in main for users to see without pushing a new release! in that case, i think it's a good idea to somehow allow skipping the release, for example by writing [skip release] in the body.

rename config back to `config.sh`

in 2a73fc6 i renamed the config file from config.sh to mummy.conf but actually that's much less clear. like with fish, it's config.fish, i.e. <what it is>.<kind of file>, and with mummy it's definitely a config file and it's a shell file. using that filetype tells the user it should be a valid shell script

support newline characters anywhere using a special character

would be great if users could use newlines in their strings again. i removed it before to significantly speed up parsing. but i can retain that speed of parsing if i just let users insert a special character for newlines (maybe \n) that isn't recognised as a newline by tools such as grep, and then replaces \n with newlines before displaying the output!

add to a `.deb` build server of sorts

mommy is available on aur, brew, and copr, so now i should also aim to release her on some build server for .debs. maybe opensuse build service? or maybe launchpad? (is launchpad appropriate for debian?)

rewrite installation instructions

i think it'd be more useful to categorise the installation instructions by operating system instead of by installation method.

also, i should look into instructions for opensuse. the packages are so extremely simple (it's just moving a few files) that there should not be any compatibility issues like there would be if C-code were compiled for a different system. the issue with opensuse in my experiments was that you have to manually specify which RHEL-version you use, and i don't know what that means in terms of opensuse (e.g. is there a command you can use to get your highest RHEL compatibility version?)

trim leading and trailing newlines

in dash, if you do PS1="\$(mommy -e \"return \$?\") $" you will see mommy's compliments/encouragements in the prompt itself, but encouragements contain a trailing newline which isn't nice, should probably be stripped from all templates automatically (also update the readme to say this has been fixed)

make man-db dependency optional for aur package

the aur package currently depends on man-db, but this is not strictly necessary. instead, this dependency should be removed. this requires that the tests support not having man installed. probably an if clause around the part testing man, which checks if a certain environment variable is set, say, MOMMY_TEST_MAN?

fully automate release process

a few things that are currently semi-automated but should be fully automated:

  • release is first set to draft, and then manually released. but that is working fine now, i don't need to verify everything manually anymore, just release it right away
  • for https://github.com/FWDekker/homebrew-mommy i have to manually trigger the Update workflow. make it so that this is done automatically. best idea: commit and push to homebrew-mommy from inside this repo. now i only need to figure out where to do the installation verification for homebrew then...
  • for aur, i should locally check out the aur repo containing the pkgbuild, update the necessary info, and then push back~ here i need to put the ssh key for uploading somewhere, and also see if i can use my pgp key somewhere, and preferably also check the sha256 sum!

word filters

variable with words that are filtered out, so templates are never used, so users can disable those words without having to redefine all the templates

allow sourcing mommy script

in line with #51, a new way of using mommy would be to source the script and then use the mommy function. i expect that this may lower the barrier of usage for users who'd rather not install essentially untrusted software.

mommy fails tests when installed with `yay`

On Arch Linux, mommy fails to install when installed with yay. However, the same error does not occur with makepkg.

==> Starting check()...
Running: /usr/bin/sh [bash 5.1.16(1)-release]
..FFFF..........................................................

Examples:
  1) mommy command-line options -h/--help: help information outputs help information using -h
     When run ../../main/sh/mommy -h

     1.1) The word 1 of output should equal mommy(1)

            expected: "mommy(1)"
                 got: <unset>

          # src/test/sh/mommy_spec.sh:36

     1.2) The status should be success

            expected: success (zero)
                 got: failure (non-zero) [status: 16]

          # src/test/sh/mommy_spec.sh:37

     1.3) WARNING: There was output to stderr but not found expectation

            stderr: /usr/bin/man: ../../main/sh/../resources/mommy.1: No such file or directory
            No manual entry for ../../main/sh/../resources/mommy.1

          # src/test/sh/mommy_spec.sh:34-38

  2) mommy command-line options -h/--help: help information outputs help information using --help
     When run ../../main/sh/mommy --help

     2.1) The word 1 of output should equal mommy(1)

            expected: "mommy(1)"
                 got: <unset>

          # src/test/sh/mommy_spec.sh:42

     2.2) The status should be success

            expected: success (zero)
                 got: failure (non-zero) [status: 16]

          # src/test/sh/mommy_spec.sh:43

     2.3) WARNING: There was output to stderr but not found expectation

            stderr: /usr/bin/man: ../../main/sh/../resources/mommy.1: No such file or directory
            No manual entry for ../../main/sh/../resources/mommy.1

          # src/test/sh/mommy_spec.sh:40-44

  3) mommy command-line options -h/--help: help information outputs help information even when -h is not the first option
     When run ../../main/sh/mommy -s 432 -h

     3.1) The word 1 of output should equal mommy(1)

            expected: "mommy(1)"
                 got: <unset>

          # src/test/sh/mommy_spec.sh:48

     3.2) The status should be success

            expected: success (zero)
                 got: failure (non-zero) [status: 16]

          # src/test/sh/mommy_spec.sh:49

     3.3) WARNING: There was output to stderr but not found expectation

            stderr: /usr/bin/man: ../../main/sh/../resources/mommy.1: No such file or directory
            No manual entry for ../../main/sh/../resources/mommy.1

          # src/test/sh/mommy_spec.sh:46-50

  4) mommy command-line options -h/--help: help information outputs help information even when --help is not the first option
     When run ../../main/sh/mommy -s 221 --help

     4.1) The word 1 of output should equal mommy(1)

            expected: "mommy(1)"
                 got: <unset>

          # src/test/sh/mommy_spec.sh:54

     4.2) The status should be success

            expected: success (zero)
                 got: failure (non-zero) [status: 16]

          # src/test/sh/mommy_spec.sh:55

     4.3) WARNING: There was output to stderr but not found expectation

            stderr: /usr/bin/man: ../../main/sh/../resources/mommy.1: No such file or directory
            No manual entry for ../../main/sh/../resources/mommy.1

          # src/test/sh/mommy_spec.sh:52-56

Finished in 5.95 seconds (user 7.44 seconds, sys 2.96 seconds)
64 examples, 4 failures


Failure examples / Errors: (Listed here affect your suite's status)

shellspec src/test/sh/mommy_spec.sh:34 # 1) mommy command-line options -h/--help: help information outputs help information using -h FAILED
shellspec src/test/sh/mommy_spec.sh:40 # 2) mommy command-line options -h/--help: help information outputs help information using --help FAILED
shellspec src/test/sh/mommy_spec.sh:46 # 3) mommy command-line options -h/--help: help information outputs help information even when -h is not the first option FAILED
shellspec src/test/sh/mommy_spec.sh:52 # 4) mommy command-line options -h/--help: help information outputs help information even when --help is not the first option FAILED

==> ERROR: A failure occurred in check().
    Aborting...
 -> error making: mommy

support colours in zsh right prompt

adding

set -o PROMPT_SUBST
RPS1='$(mommy -1 -s $?)'

to .zshrc will write mommy's output to the right prompt, but if colours are enabled it looks like zsh over-estimates the size of the right prompt causing some weird display glitches :(

maybe I can resolve this by adding a prefix and suffix command and instructing zsh users to use those to add zsh-specific colour commands in those?

tests

check if mommy is really supporting~

cd

create releases automatically, also for macos

fix newlines in release notes

the automatically-generated release notes from the changelog in cd.yml contain annoying newlines because github thinks every newline is actually a newline and not just whitespace for readability. this should be fixed, either by changing the changelog or by changing the release process

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.