63 lines
2.9 KiB
Markdown
63 lines
2.9 KiB
Markdown
# Shared shell profile
|
|
|
|
This repository owns the login environment and interactive commands intended
|
|
to be shared by Bourne-family shells.
|
|
|
|
"Shared" means shells capable of reading POSIX-style `sh`, such as `sh`, Bash,
|
|
Dash and—with appropriate compatibility—Zsh. It does not mean that the same
|
|
file can be sourced directly by shells with different languages, such as Fish
|
|
or Nushell.
|
|
|
|
## Responsibilities
|
|
|
|
- Install `~/.profile` as a symlink into this repository.
|
|
- Define XDG locations and general editor/browser environment variables.
|
|
- Construct PATH idempotently for language and user-level executable paths.
|
|
- Load environment setup that is portable at login, such as Cargo's `env` file.
|
|
- Provide common aliases and small interactive functions that are useful
|
|
across supported Bourne-family shells.
|
|
- Isolate Arch Linux commands from otherwise portable shell configuration.
|
|
|
|
## Boundaries
|
|
|
|
The `profile` file must remain quiet, idempotent and safe for a POSIX shell to
|
|
source during login. It must not print an alias catalogue, configure a prompt,
|
|
perform interactive terminal operations or start background work.
|
|
|
|
Interactive shells should source `interactive.sh` from their own RC file. The
|
|
login profile deliberately does not source it, because login profiles may also
|
|
run in non-interactive sessions.
|
|
|
|
Shell-specific prompt, history, completion and initialization belongs in the
|
|
corresponding shell repository, currently `bash`. User services and timers
|
|
belong in the separate `systemd` repository.
|
|
|
|
## Files
|
|
|
|
- `profile`: portable login environment and PATH construction.
|
|
- `interactive.sh`: POSIX loader and manually curated alias reminder.
|
|
- `aliases.sh`: common POSIX interactive aliases and helper functions.
|
|
- `commands.sh`: command-catalogue display and validation functions.
|
|
- `hosts.sh`: SSH destination listing function.
|
|
- `platform/arch.sh`: Arch Linux applications, GNU options and Pacman/systemd
|
|
integration, written with POSIX shell syntax.
|
|
- `commands.tsv`: curated command descriptions and reminder visibility.
|
|
- `commands.README.md`: format and maintenance instructions for `commands.tsv`.
|
|
- `memory.tsv`: selectively curated shell-memory questions and answers.
|
|
- `memory.README.md`: format, scope and daily-selection behavior for the memory
|
|
question bank.
|
|
- `install.sh`: installs the `~/.profile` symlink.
|
|
|
|
## Alias portability
|
|
|
|
The shared interactive files use POSIX shell syntax. Bash-only compatibility
|
|
aliases—including names that are deliberately being retired—live in the Bash
|
|
repository's `aliases.bash` instead.
|
|
|
|
External commands remain platform-specific by design: aliases for Pacman,
|
|
systemd, GNU utilities and local applications target this Arch Linux setup.
|
|
Syntax portability does not imply operating-system portability.
|
|
|
|
The Arch `update` function runs the local `archnews_wrap` Pacman workflow and,
|
|
after a successful upgrade, requests a non-blocking refresh from the systemd
|
|
user service `package-status-refresh.service`.
|