diff --git a/README.md b/README.md new file mode 100644 index 0000000..41f0b0d --- /dev/null +++ b/README.md @@ -0,0 +1,51 @@ +# Bash configuration + +This repository owns configuration that is specific to interactive Bash and +the Bash login sequence. + +## Responsibilities + +- Install `~/.bash_profile` and `~/.bashrc` as symlinks into this repository. +- Make login Bash load the shared `~/.profile` environment before `.bashrc`. +- Configure Bash history, prompt rendering, completion and command-not-found + behaviour. +- Initialize Bash integrations such as NVM, Pyenv, z.lua and gitstatus. +- Display the startup greeting and cached package status. +- Display `TODO.md` and `.autonote.md` after successful directory changes. +- Load common interactive aliases from the `profile` repository. + +## Boundaries + +This repository does not own: + +- Portable login environment variables or shared PATH construction. Those + belong in the `profile` repository. +- Common aliases intended for more than one Bourne-family shell. Those belong + in `profile/aliases.sh`; genuinely Bash-specific aliases may live here. +- User services, timers or background refresh logic. Those belong in the + `systemd` repository. Bash may consume their cached output or request a + non-blocking service start. +- Secrets, machine credentials or project-specific environment settings. + +## Startup flow + +A login Bash reads: + +```text +~/.bash_profile -> ~/.profile -> ~/.bashrc +``` + +A non-login interactive Bash reads only `~/.bashrc` and inherits the login +environment from its parent process. `.bashrc` returns immediately when the +shell is not interactive. + +## Files + +- `bash_profile`: connects Bash login startup to the shared profile and Bash RC. +- `bashrc`: interactive Bash configuration. +- `gitstatus-custom.sh`: prompt integration for gitstatus. +- `cheat.bash`: completion for `cheat`. +- `install.sh`: installs the home-directory symlinks and gitstatus dependency. + +Run `install.sh` when initially installing the repository. It preserves an +existing destination before creating each symlink. diff --git a/bashrc b/bashrc index 4c6feaf..d78a043 100644 --- a/bashrc +++ b/bashrc @@ -259,9 +259,10 @@ unset _package_status_checked_at _package_status_pacman_log_signature unset _package_status_now _package_status_current_pacman_log_signature unset _package_status_key _package_status_value -echo "Remember your commands:" -echo -e " ${_WHITE}nap hyprpicker nmcli lftp lxc-wp qv4l2 cheat vimv rclone mid3v2 zathura tesseract remmina${_NC}" -echo -e " ${_WHITE}wl-copy wl-paste${_NC}" +echo "Remember commands:" +printf '%b' "$_WHITE" +_command_reminder +printf '%b\n' "$_NC" echo "" if [ ${_mem_available%.*} -lt 5 ] ; then @@ -301,8 +302,7 @@ fi echo "" -echo -e "Remember \"${_BLUE}TODO.md${_NC}\" and \"${_BLUE}autonote.md${_NC}\" files have content automatically displayed." -echo -e "Edit these with ${_BLUE}et${_NC} and ${_BLUE}ea${_NC}" +echo -e "Remember \"${_BLUE}TODO.md${_NC}\" (${_BLUE}et${_NC}) and \"${_BLUE}autonote.md${_NC}\" (${_BLUE}ea${_NC}) files have content automatically displayed." echo "" [ -r "$HOME/.config/bash/cheat.bash" ] && . "$HOME/.config/bash/cheat.bash"