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.pnpmsupport.
- 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.commitjoke- Random commit message fromwhatthecommit.com.cp- Copy with overwrite confirmation and verbose output.dadjoke- Random dad joke fromicanhazdadjoke.com.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).shrug- Print the shrug emoticon.sudo- Preserves alias expansion when usingsudo.tableflip- Print the table flip emoticon.tableunflip- Print the table unflip emoticon.timestamp- Print current UTC timestamp in ISO 8601 format.weather- Terminal weather forecast viawttr.in.
bak- Back up a file with a
.bakextension.
- Back up a file with a
coinflip- Flip a coin.
mkcd- Create a directory and
cdinto it in one step.
- Create a directory and
psg- Search running processes by name. Filters out the
grepprocess itself.
- Search running processes by name. Filters out the
roll- Roll a die (d6 by default, or specify sides).
tempdir- Create and
cdinto a disposable temporary directory.
- Create and
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_help- Prints a quick reference of all aliases and functions.
_urdabash_info- Prints information about the current
urda.bashconfiguration.
- Prints information about the current
_urdabash_update- Self-updates
urda.bashby fetching the latest files from GitHub. Nogitrequired.
- Self-updates
_urdabash_version_check- Checks for a newer
urda.bashrelease on GitHub. Passnowfor an on-demand check.
- Checks for a newer
Bootstrap urda.bash on a new machine with a single command:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/urda/urda.bash/master/install.sh)"urda.bash checks for new releases weekly in the background. If a newer version is found, a notice is printed on your next shell startup. To update, run:
_urdabash_updateYou can also force an on-demand version check:
_urdabash_version_check nowVersion 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.
If ~/.bash_local exists, it is sourced automatically after all other files. Use this file for machine-specific aliases, functions, or overrides that should survive upgrades.
If ~/.bash_secrets exists, it is sourced automatically. Use this file for API tokens, credentials, or any other private environment variables.
You 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.