Update.
authorFrancois Fleuret <francois@fleuret.org>
Fri, 6 Feb 2015 20:21:49 +0000 (21:21 +0100)
committerFrancois Fleuret <francois@fleuret.org>
Fri, 6 Feb 2015 20:21:49 +0000 (21:21 +0100)
bashrc

diff --git a/bashrc b/bashrc
index 178504e..cb98ffa 100644 (file)
--- a/bashrc
+++ b/bashrc
@@ -710,25 +710,19 @@ else
 
     [[ "${IDENT}" ]] && IDENT="${IDENT}:"
 
-    # If we are root, show that in red
-
     if [[ ${USER} == "root" ]]; then
+        # If we are root, show that in red
         PS1="\[${VT_RED_BG}${VT_WHITE_FG}\]${IDENT}\w\[${VT_RESET}\] "
     else
-        PS1="\[${VT_WHITE_BG}${VT_BLACK_FG}\]${IDENT}\w\[${VT_RESET}\] "
+        if [[ $(\grep QEMU /proc/cpuinfo) ]]; then
+            # If we are in a qemu virtual machine, in yellow
+            PS1="\[${VT_YELLOW_BG}${VT_BLACK_FG}\]${IDENT}\w\[${VT_RESET}\] "
+        else
+            # Otherwise in white
+            PS1="\[${VT_WHITE_BG}${VT_BLACK_FG}\]${IDENT}\w\[${VT_RESET}\] "
+        fi
     fi
 
-    # In an xterm, show the hostname and path in the title bar, highlight
-    # the prompt
-
-    # [[ "${TERMS_WITH_BAR}" ]] || TERMS_WITH_BAR="^xterm|screen$"
-
-    # if [[ "${TERM}" =~ "${TERMS_WITH_BAR}" ]]; then
-    # PS1="\[${VT_SET_TITLE}shell@\h (\w)${VT_END_TITLE}${VT_WHITE_BG}\]${IDENT}\w\[${VT_RESET}\] "
-    # else
-    # PS1="\[${VT_WHITE_BG}\]${IDENT}\w\[${VT_RESET}\] "
-    # fi
-
 fi
 
 ######################################################################