[bash] Color propt based on machine type
This commit is contained in:
parent
2bafa9c8ff
commit
82a3781852
11
bashrc
11
bashrc
@ -2,6 +2,9 @@
|
|||||||
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
|
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
|
||||||
# for examples
|
# for examples
|
||||||
|
|
||||||
|
SERVER_FLAG_FILE=$HOME/.server
|
||||||
|
WORK_FLAG_FILE=$HOME/.work
|
||||||
|
|
||||||
# If not running interactively, don't do anything
|
# If not running interactively, don't do anything
|
||||||
case $- in
|
case $- in
|
||||||
*i*) ;;
|
*i*) ;;
|
||||||
@ -57,7 +60,15 @@ if [ -n "$force_color_prompt" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$color_prompt" = yes ]; then
|
if [ "$color_prompt" = yes ]; then
|
||||||
|
if [ -f $SERVER_FLAG_FILE ]; then
|
||||||
|
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\[\033[34m\]\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
|
||||||
|
else
|
||||||
|
if [ -f $WORK_FLAG_FILE ]; then
|
||||||
|
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\[\033[33m\]\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
|
||||||
|
else
|
||||||
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
|
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
|
||||||
|
fi
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
|
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user