Show different prompts when in a vm
This commit is contained in:
parent
015660d6f4
commit
fda37efc28
2 changed files with 13 additions and 1 deletions
7
.bashrc
7
.bashrc
|
|
@ -48,8 +48,13 @@ if [ -n "$force_color_prompt" ]; then
|
|||
fi
|
||||
fi
|
||||
|
||||
# Show different prompts for vm users or "normal" users
|
||||
if [ "$color_prompt" = yes ]; then
|
||||
PS1="\[\033[1;33m\]\u\[\033[1;34m\]@\[\033[1;32m\]\h \[\033[1;34m\]\w\\[\033[0;37m\]$ "
|
||||
if [ $VM = true ]; then
|
||||
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
|
||||
else
|
||||
PS1="\[\033[1;33m\]\u\[\033[1;34m\]@\[\033[1;32m\]\h \[\033[1;34m\]\w\\[\033[0;37m\]$ "
|
||||
fi
|
||||
else
|
||||
PS1='\u@\h:\w\$ '
|
||||
fi
|
||||
|
|
|
|||
7
.profile
7
.profile
|
|
@ -5,6 +5,13 @@ export PAGER=less
|
|||
export BROWSER=/usr/bin/firefox
|
||||
|
||||
|
||||
VM=false
|
||||
if [ "$(grep hypervisor /proc/cpuinfo)" ]; then
|
||||
VM=true
|
||||
fi
|
||||
|
||||
export VM
|
||||
|
||||
SSH_ENV="$HOME/.ssh/environment"
|
||||
function start_agent {
|
||||
/usr/bin/ssh-agent | sed 's/^echo/#echo/' > "${SSH_ENV}"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue