oh-my-posh moved from a curl installer to a Fedora package, and the shell config invoked it unconditionally. That is fine during a full install, where install-packages runs before the bashrc is linked -- and not fine in every other order: a stage re-run by hand, an install that failed partway, or the moment between removing the old binary and installing the package. Same guard as the nvm source above it. An unthemed prompt is a worse shell; one printing command-not-found before every prompt is a machine that looks broken. Claude-Session: https://claude.ai/code/session_01Q84axqUE5inJhf5Jz9CFy1
54 lines
1.9 KiB
Bash
54 lines
1.9 KiB
Bash
#!/usr/bin/env bash
|
|
|
|
# Editor used by CLI
|
|
export EDITOR="nvim"
|
|
export SUDO_EDITOR="$EDITOR"
|
|
export SSH_ASKPASS=/usr/bin/ksshaskpass
|
|
export SSH_ASKPASS_REQUIRE=prefer
|
|
|
|
# Define Paths
|
|
export CARGO_PATH="$HOME/.cargo"
|
|
export BUN_INSTALL="$HOME/.bun"
|
|
export PYENV_ROOT="$HOME/.pyenv"
|
|
export PNPM_HOME="$HOME/.local/share/pnpm"
|
|
export NVM_DIR="$HOME/.nvm"
|
|
export ANDROID_SDK_HOME="$HOME/.local/share/Android"
|
|
export GOPATH="$HOME/.local/share/go"
|
|
export DOTNETPATH="$HOME/.dotnet/tools"
|
|
|
|
# Podman
|
|
# export DOCKER_HOST=unix:///run/user/1000/podman/podman.sock
|
|
|
|
# Set complete path
|
|
export PATH="$HOME/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$PANAMA_PATH/bin:$BUN_INSTALL/bin:$CARGO_PATH/bin:$PNPM_HOME/bin:$PYENV_ROOT/bin:$HOME/.rbenv/bin:/usr/lib/ccache/bin/:$GOPATH/bin:$DOTNETPATH"
|
|
|
|
# Nvm. Guarded because the file belongs to the nvm package: before that is
|
|
# installed it does not exist, and an unconditional source means every shell on
|
|
# a fresh machine opens with an error.
|
|
[ -f /etc/profile.d/nvm.sh ] && source /etc/profile.d/nvm.sh
|
|
# Auto-switch Node version when entering a directory with .nvmrc
|
|
_nvm_auto_use() {
|
|
if [[ -f .nvmrc ]]; then
|
|
nvm use --silent
|
|
fi
|
|
}
|
|
export PROMPT_COMMAND="${PROMPT_COMMAND:+$PROMPT_COMMAND; }_nvm_auto_use"
|
|
|
|
# Auto-start or attach tmux for SSH interactive shells
|
|
if [[ -n "$SSH_CONNECTION" && -z "$TMUX" && $- == *i* ]]; then
|
|
exec tmux new-session -A -s main
|
|
fi
|
|
|
|
# Zoxide
|
|
eval "$(zoxide init bash)"
|
|
|
|
# Oh My Posh
|
|
# Guarded for the same reason the nvm source above is: oh-my-posh is a package,
|
|
# and a shell opened before it is installed -- a stage re-run by hand, an
|
|
# install that failed partway -- would otherwise print command-not-found on
|
|
# every prompt. An unthemed prompt is a worse shell; an erroring one is a
|
|
# broken-looking machine.
|
|
if command -v oh-my-posh >/dev/null 2>&1; then
|
|
eval "$(oh-my-posh init bash --config "$PANAMA_PATH/config/dot/ohmyposh/gib.omp.json")"
|
|
fi
|