This is a collection of my bash prompt settings, aliases, exports, and other related shell scripts.
- Exposes the
XDG Base Directoryspecification variables. - Supports loading
bashshell parts based on host operating system:bash_linux- For Linux platforms.bash_osx- For macOS platforms (supportsbash-completionv1 and v2).
- Loads common definitions from:
bash_exports- Environment variables.bash_aliases- Aliases.bash_functions- Functions.
- Displays "information lines" in shell:
gitworking state information.screensession name.
- Understands various tools and tooling in shell:
- 1Password CLI support.
direnvsupport.fnmsupport.
- Weekly
VERSIONcheck against GitHub remote (non-blocking).- Also supports on-demand version checking with
_urdabash_version_check now
- Also supports on-demand version checking with
Should work with bash 3.2 or higher.
clear- Hard reset the terminal screen.cp- Copy with overwrite confirmation and verbose output.diff- Unified diff format, with color viacolordiffwhen available.epoch- Print current unix timestamp (seconds).get_uuid- Generate a random UUID.headers- Fetch HTTP response headers only.ll- Long listing format (ls -hlF).moon- Current moon phase viawttr.in.mv- Move with overwrite confirmation and verbose output.path- PrintPATHentries, one per line.publicip- Print public IP address.serve- Start a quick HTTP server in the current directory (port 8000).sudo- Preserves alias expansion when usingsudo.weather- Terminal weather forecast viawttr.in.
psg- Search running processes by name. Filters out the
grepprocess itself.
- Search running processes by name. Filters out the
unarc- Extract common archive formats by file extension.
update_brew(macOS only)- Runs
brew update,upgrade,autoremove,cleanup, anddoctorin sequence.
- Runs
These are internal helpers for urda.bash. You should not rely on them as a public API.
_prepend_path_once- Prepends a value to
${PATH}once, avoiding duplicates.
- Prepends a value to
_source_if_exists- Sources a file if it exists, skips otherwise.
_urdabash_info- Prints information about the current
urda.bashconfiguration.
- Prints information about the current
_urdabash_version_check- Checks for a newer
urda.bashrelease on GitHub. Passnowfor an on-demand check.
- Checks for a newer
urda.bash checks for new releases weekly by fetching the VERSION file from GitHub in the background. If a newer version is available, a notice is printed on the next shell startup. This check is non-blocking and will not slow down your shell.
Version check state is stored at ${XDG_STATE_HOME}/urda.bash/ (~/.local/state/urda.bash/):
last_check- Timestamp file used to determine when the next fetch is due.remote_version- Cached remote version string from the last successful fetch.
You can also trigger an on-demand check:
_urdabash_version_check nowYou can run a bare make or make help to display the help screen.
After you clone this repo, you can also run a quick diff that will compare your local bash files against the repo files:
make diffsThis will also run a make version-check.
make testWARNING! This is a DESTRUCTIVE operation and copies bash files from the project into your ${HOME}.
make copyJust run make version-check.