playbooks/lxc/templates/bash.bashrc.j2

52 lines
1.1 KiB
Plaintext
Raw Normal View History

#
# Add other environments, when available
#
if [ -f /fritzlab/environment ]; then
source /fritzlab/environment
fi
if [ -f /etc/os-release ]; then
source /etc/os-release
fi
#
# Customize the Bash prompt with color-coded sections and fallback defaults.
#
# colors
RED="\[\033[1;31m\]" # Bright red
GREEN="\[\033[1;32m\]" # Bright green
YELLOW="\[\033[1;33m\]" # Bright yellow
BLUE="\[\033[1;34m\]" # Bright blue
RESET="\[\033[0m\]" # Reset to default color
# prompt parts
if [ -n "${ID}" ] && [ -n "${VERSION_ID}" ]; then
SYSTEM="${ID}${VERSION_ID}"
else
SYSTEM=$(uname -r)
fi
REGION="${FRITZLAB_REGION:-unknown}"
APP="${FRITZLAB_APP_NAME:-unknown}"
HOSTNAME=$(hostname)
# prompt format
export PS1="${RED}${SYSTEM}${RESET} ${GREEN}${APP}${RESET} ${YELLOW}${REGION}${RESET} ${BLUE}${HOSTNAME}${RESET} \n(\u) \w \$ "
#
# Set the history size and control options.
#
export HISTSIZE=1000
export HISTFILESIZE=2000
export HISTCONTROL=ignoredups:erasedups
shopt -s histappend
#
# Set the default editor.
#
export TERM=xterm-256color
#
# bash aliases
#
alias ll="ls -lFah"