PS1 given machines

This commit is contained in:
Frank Villaro-Dixon 2014-08-05 20:12:15 +02:00
parent 1361ff6cba
commit 4b8142e96f
2 changed files with 13 additions and 9 deletions

View file

@ -81,17 +81,21 @@ PathFull="\W"
NewLine="\n"
Jobs="\j"
__git_ps1 ()
{
__git_ps1 ()
{
local b="$(git symbolic-ref HEAD 2>/dev/null)";
if [ -n "$b" ]; then
printf " (%s)" "${b##refs/heads/}";
fi
}
if [ $HOSTNAME = "intersect" ]; then
IntroCol=$BIBlack;
else
IntroCol=$BIRed;
fi
export PS1=$BIBlack$Time12h$Color_Off'$(git branch &>/dev/null;\
export PS1=$IntroCol$Time12h$Color_Off'$(git branch &>/dev/null;\
if [ $? -eq 0 ]; then \
echo "$(echo `git status` | grep "nothing to commit" > /dev/null 2>&1; \
if [ "$?" -eq "0" ]; then \

10
bashrc
View file

@ -54,11 +54,11 @@ esac
#PS1="\[$RED\]\u\[$DFT$white\]@\[$magenta\]\h \[$DFT\]>>\[$CYAN\]\w \[$DFT\]"
#PROMPT_COMMAND='history -a;echo -en "\033[m\033[38;5;2m"$(( `sed -nu "s/MemFree:[\t ]\+\([0-9]\+\) kB/\1/p" /proc/meminfo`/1024))"\033[38;5;22m/"$((`sed -nu "s/MemTotal:[\t ]\+\([0-9]\+\) kB/\1/Ip" /proc/meminfo`/1024 ))MB"\t\033[m\033[38;5;55m$(< /proc/loadavg)\033[m"'
if [ "$HOSTNAME" == "chuck" ]; then
MY_HOST_COL='[31m' #ugly !
else
MY_HOST_COL='[34m'
fi
#if [ "$HOSTNAME" == "chuck" ]; then
# MY_HOST_COL='[31m' #ugly !
#else
# MY_HOST_COL='[34m'
#fi
#PS1='\[\e[0;36m\]\t \[\e[1;30m\][\[\e$MY_HOST_COL\]\u@\H\[\e[1;30m\]\[\e[0;32m\]\[\e[1;30m\]] \[\e[1;37m\]\w\[\e[0;37m\] \n$ '
source ~/.bash_ps1