Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Define some basic colors using tput (8-bit color: 256 colors)
- red="\[$(tput setaf 160)\]"
- bright_red="\[$(tput setaf 196)\]"
- light_purple="\[$(tput setaf 60)\]"
- orange="\[$(tput setaf 172)\]"
- blue="\[$(tput setaf 21)\]"
- light_blue="\[$(tput setaf 80)\]"
- magenta="\[$(tput setaf 162)\]"
- hot_pink="\[$(tput setaf 200)\]"
- violet="\[$(tput setaf 171)\]"
- bold="\[$(tput bold)\]"
- start_underline="\[$(tput smul)\]"
- end_underline="\[$(tput rmul)\]"
- reset="\[$(tput sgr0)\]"
- # Define basic colors to be used in prompt
- ## The color for username (light_blue, for root user: bright_red)
- username_color="${reset}${bold}${light_blue}\$([[ \${EUID} == 0 ]] && echo \"${bright_re >
- ## Color of @ and ✗ symbols (orange)
- at_color=$reset$bold$orange
- ## Color of host/pc-name (blue)
- host_color=$reset$bold$blue
- ## Color of current working directory (light_purple)
- directory_color=$reset$light_purple
- ## Color for other characters (like the arrow)
- etc_color=$reset$red
- # If last operation did not succeded, add [✗]- to the prompt
- on_error="\$([[ \$? != 0 ]] && echo \"${etc_color}[${at_color}✗${etc_color}]─\")"
- # The last symbol in prompt ($, for root user: #)
- symbol="${reset}${bold}${bright_red}$(if [[ ${EUID} == 0 ]]; then echo '#'; else echo '$ >
- ## Colour of date
- date_colour="$reset$bold$magenta"
- ## Colour of time
- time_colour="$reset$bold$violet"
- # Setup the prompt/prefix for linux terminal
- PS1="${etc_color}┌─${on_error}[";
- PS1+="${username_color}\u";
- PS1+="${at_color}@";
- PS1+="${host_color}\h"
- PS1+="${etc_color}]-[";
- PS1+="${directory_color}\w";
- PS1+="${etc_color}]\n└──╼ ";
- PS1+="${date_colour}\D{%d-%m-%Y}";
- PS1+="${time_colour}\A";
- PS1+="${etc_color}\n └──╼ ";
- PS1+="${symbol}${reset}";
- ## \u=Working directory
- ## \n=New Line
- ## \u=Username
- ## \h=Host
- ## \D{%d-%m-%Y}=Date
- ## \A=time
- export PS1
Advertisement
Add Comment
Please, Sign In to add comment