first commit

This commit is contained in:
julien
2025-09-08 15:26:25 +02:00
commit edc4729b55
7 changed files with 387 additions and 0 deletions

4
etc/skel/.bash_profile Normal file
View File

@@ -0,0 +1,4 @@
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi

29
etc/skel/.bashrc Normal file
View File

@@ -0,0 +1,29 @@
PROMPT_COMMAND=__prompt_command
__prompt_command() {
# Store current exit code
local EXIT="$?"
# Define some colors
local RESET='\[\e[0m\]'
local RED='\[\e[0;31m\]'
local GREEN='\[\e[0;32m\]'
local BOLD_GRAY='\[\e[1;30m\]'
# Start with an empty PS1
PS1=""
if [[ $EXIT -eq 0 ]]; then
# Add green if exit code 0
PS1+="${GREEN}0${RESET} "
else
# Add red if exit code non 0
PS1+="${RED}${EXIT}${RESET} "
fi
# These are the default prompts for root and user
if [ $(id -u) -eq 0 ]; then
PS1+="\u@\h:\w ($(ls | wc -l)) ${RESET}# "
else
PS1+="\u@\h:\w ($(ls | wc -l)) ${RESET}$ "
fi
}