Skip to content

Instantly share code, notes, and snippets.

@WhatsARanjit
Last active September 17, 2018 16:33
Show Gist options
  • Save WhatsARanjit/d8bc6a06f31a7cf1835f5e3c74e550a3 to your computer and use it in GitHub Desktop.
Save WhatsARanjit/d8bc6a06f31a7cf1835f5e3c74e550a3 to your computer and use it in GitHub Desktop.
# .bashrc
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# Uncomment the following line if you don't like systemctl's auto-paging feature:
# export SYSTEMD_PAGER=
# User specific aliases and functions
if tput setaf 1 &> /dev/null; then
if [[ $(tput colors) -ge 256 ]] 2>/dev/null; then
MAGENTA=$(tput setaf 9)
ORANGE=$(tput setaf 172)
GREEN=$(tput setaf 190)
PURPLE=$(tput setaf 141)
WHITE=$(tput setaf 0)
else
MAGENTA=$(tput setaf 5)
ORANGE=$(tput setaf 4)
GREEN=$(tput setaf 2)
PURPLE=$(tput setaf 1)
WHITE=$(tput setaf 7)
fi
BOLD=$(tput bold)
RESET=$(tput sgr0)
else
MAGENTA="\033[1;31m"
ORANGE="\033[1;33m"
GREEN="\033[1;32m"
PURPLE="\033[1;35m"
WHITE="\033[1;37m"
BOLD=""
RESET="\033[m"
fi
export MAGENTA
export ORANGE
export GREEN
export PURPLE
export WHITE
export BOLD
export RESET
SHORT_NAME=$(hostname -s)
[[ -f ~/.${SHORT_NAME}rc ]] && source ~/.${SHORT_NAME}rc
export PS1="\[${ORANGE}\][\[${BOLD}${WHITE}\]\u@\h \[${GREEN}\]\w\[${BOLD}\]\[${WHITE}\]\[${RESET}\]\[${ORANGE}\]]\[${RESET}\]# "
export PS1="\[${ORANGE}\][\[${BOLD}${ORANGE}\]\u@\h \[${GREEN}\]\w\[${BOLD}\]\[${ORANGE}\]\[${RESET}\]\[${ORANGE}\]]\[${RESET}\]# "
export PS1="\[${ORANGE}\][\[${BOLD}${PURPLE}\]\u@\h \[${GREEN}\]\w\[${BOLD}\]\[${PURPLE}\]\[${RESET}\]\[${ORANGE}\]]\[${RESET}\]# "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment