From 3e3a5e4883e1249f6d1f8676a5c4e77607c4b2ed Mon Sep 17 00:00:00 2001 From: "Bradan J. Wolbeck" Date: Tue, 16 Jun 2026 23:44:18 -0600 Subject: [PATCH] feat(bash): add managed bashrc --- bash/bashrc | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ install.sh | 2 ++ 2 files changed, 51 insertions(+) create mode 100644 bash/bashrc diff --git a/bash/bashrc b/bash/bashrc new file mode 100644 index 0000000..f6444be --- /dev/null +++ b/bash/bashrc @@ -0,0 +1,49 @@ +# If not running interactively, don't do anything +[[ $- != *i* ]] && return + +if command -v dircolors >/dev/null 2>&1; then + eval "$(dircolors)" +fi +alias ls='ls --color=auto' +alias ll='ls --color=auto -l' +alias l='ls --color=auto -lA' + +DISTRO='unknown' + +# Generic distro check. +if [[ -r /etc/os-release ]]; then + . /etc/os-release + DISTRO=${ID:-unknown} +fi + +# Proxmox uses Debian's /etc/os-release, try checking if it has a folder in the ESP. +if [[ -d /boot/efi/EFI/proxmox ]]; then + DISTRO='proxmox' +fi + +case "$DISTRO" in + proxmox|ubuntu) + DISTRO_COLOR='\[\e[38;5;208;3;4m\]' + ;; + debian) + DISTRO_COLOR='\[\e[38;5;160;3;4m\]' + ;; + void) + DISTRO_COLOR='\[\e[38;5;28;3;4m\]' + ;; + *) + DISTRO_COLOR='\[\e[3;4m\]' + ;; +esac + +HOST_COLOR='\[\e[38;5;99m\]' + +if [[ $EUID -eq 0 ]]; then + USER_COLOR='\[\e[38;5;160m\]' + PROMPT_COLOR='\[\e[1;38;5;160m\]' +else + USER_COLOR='\[\e[38;5;33m\]' + PROMPT_COLOR='\[\e[0;1m\]' +fi + +PS1="${USER_COLOR}"'\u\[\e[0m\]@'"${HOST_COLOR}"'\h\[\e[0m\]:\[\e[38;5;219;3m\]\w\[\e[0m\] '"${DISTRO_COLOR}${DISTRO:-unknown}"'\[\e[0m\]'"${PROMPT_COLOR}"'\$\[\e[0m\] ' diff --git a/install.sh b/install.sh index 076fe6d..3ac020e 100755 --- a/install.sh +++ b/install.sh @@ -36,3 +36,5 @@ link_file() { ln -s "$src" "$dst" echo "linked: $dst -> $src" } + +link_file "$DOTFILES/bash/bashrc" "$HOME/.bashrc"