Created
May 12, 2015 13:34
-
-
Save dgryski/660d4a336e90f3fb2cc6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function dgryski-set-prompt { | |
if [ $(tput colors) -ge 8 ]; then | |
BRED='\[\e[1;31m\]' | |
RED='\[\e[0;31m\]' | |
BGREEN='\[\e[1;32m\]' | |
GREEN='\[\e[0;32m\]' | |
BYELLOW='\[\e[1;33m\]' | |
YELLOW='\[\e[0;33m\]' | |
BBLUE='\[\e[1;34m\]' | |
BLUE='\[\e[0;34m\]' | |
BMAGENTA='\[\e[1;35m\]' | |
MAGENTA='\[\e[0;35m\]' | |
BCYAN='\[\e[1;36m\]' | |
CYAN='\[\e[0;36m\]' | |
BLACK='\[\e[0;30m\]' | |
BBLACK='\[\e[1;30m\]' | |
GRAY='\[\e[0;37m\]' | |
WHITE='\[\e[1;37m\]' | |
NO_COLOUR='\[\e[0m\]' | |
else | |
RED=""; BRED="" ; GREEN=""; BGREEN=""; YELLOW=""; BYELLOW="" | |
BLUE=""; BBLUE=""; MAGENTA=""; BMAGENTA=""; CYAN=""; BCYAN="" | |
BLACK=""; BBLACK=""; GRAY=""; WHITE=""; NO_COLOUR="" | |
fi; | |
hostname=$(hostname |cut -f1 -d.) | |
userhost="${CYAN}\u${BCYAN}@${YELLOW}$kvm${BYELLOW}$hostname" | |
dir="${GREEN}[${BBLUE}\W${GREEN}]" | |
gopher="\`if [ \$? = 0 ];then echo '\[\033[01;32m\]\ʕ◔ϖ◔ʔ/'; else echo '\[\033[01;31m\]ʕ╯◔ϖ◔ʔ╯'; fi\`\[\033[00m\]" | |
PS1="${RED}<$userhost$dir${RED}${NO_COLOUR} $gopher > " | |
unset userhost dir | |
unset RED BRED GREEN BGREEN YELLOW BYELLOW | |
unset BLUE BBLUE MAGENTA BMAGENTA CYAN BCYAN | |
unset BLACK BBLACK GREY WHITE NO_COLOUR | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment