1
0
Fork 0

Move host colour configuration to a separate file.

This commit is contained in:
Starbeamrainbowlabs 2016-03-23 20:31:40 +00:00
parent a030929c39
commit b78f5bfde7
2 changed files with 30 additions and 25 deletions

28
.bash_host Normal file
View File

@ -0,0 +1,28 @@
#!/usr/bin/env bash
##########################
### Colour Definitions ###
#### ANSI color codes ####
RS="\[\033[0m\]" # reset
HC="\[\033[1m\]" # hicolor
UL="\[\033[4m\]" # underline
INV="\[\033[7m\]" # inverse background and foreground
FBLK="\[\033[30m\]" # foreground black
FRED="\[\033[31m\]" # foreground red
FGRN="\[\033[32m\]" # foreground green
FYEL="\[\033[33m\]" # foreground yellow
FBLE="\[\033[34m\]" # foreground blue
FMAG="\[\033[35m\]" # foreground magenta
FCYN="\[\033[36m\]" # foreground cyan
FWHT="\[\033[37m\]" # foreground white
BBLK="\[\033[40m\]" # background black
BRED="\[\033[41m\]" # background red
BGRN="\[\033[42m\]" # background green
BYEL="\[\033[43m\]" # background yellow
BBLE="\[\033[44m\]" # background blue
BMAG="\[\033[45m\]" # background magenta
BCYN="\[\033[46m\]" # background cyan
BWHT="\[\033[47m\]" # background white
##########################
HOST_COLOUR="${HC}${FYEL}"

27
.bashrc
View File

@ -56,30 +56,7 @@ if [ -n "$force_color_prompt" ]; then
fi
fi
##########################
### Colour Definitions ###
#### ANSI color codes ####
RS="\[\033[0m\]" # reset
HC="\[\033[1m\]" # hicolor
UL="\[\033[4m\]" # underline
INV="\[\033[7m\]" # inverse background and foreground
FBLK="\[\033[30m\]" # foreground black
FRED="\[\033[31m\]" # foreground red
FGRN="\[\033[32m\]" # foreground green
FYEL="\[\033[33m\]" # foreground yellow
FBLE="\[\033[34m\]" # foreground blue
FMAG="\[\033[35m\]" # foreground magenta
FCYN="\[\033[36m\]" # foreground cyan
FWHT="\[\033[37m\]" # foreground white
BBLK="\[\033[40m\]" # background black
BRED="\[\033[41m\]" # background red
BGRN="\[\033[42m\]" # background green
BYEL="\[\033[43m\]" # background yellow
BBLE="\[\033[44m\]" # background blue
BMAG="\[\033[45m\]" # background magenta
BCYN="\[\033[46m\]" # background cyan
BWHT="\[\033[47m\]" # background white
##########################
. ~/.bash_host
prompt_colon()
{
@ -92,7 +69,7 @@ prompt_colon()
set_bash_prompt()
{
PS1="${debian_chroot:+($debian_chroot)}\[\033[01;33m\]\u@\H\[\033[00m\]$(prompt_colon)\[\033[01;34m\]\w\[\033[00m\]"
PS1="${debian_chroot:+($debian_chroot)}${HOST_COLOUR}\u@\H\[\033[00m\]$(prompt_colon)\[\033[01;34m\]\w\[\033[00m\]"
if [[ "$UID" = 0 ]]; then
PS1="${PS1}# "
else