From cbba5593407d5e46853a65c672dc8dacd016d379 Mon Sep 17 00:00:00 2001 From: Panayiotis Kkolos Date: Sun, 9 Mar 2014 06:40:23 +0200 Subject: [PATCH] Simplify chroot detection code --- liquidprompt | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/liquidprompt b/liquidprompt index a21d613..7fdccc6 100755 --- a/liquidprompt +++ b/liquidprompt @@ -489,19 +489,10 @@ _lp_connection() # The connection is not expected to change from inside the shell, so we # build this just once LP_HOST="" -_chroot() -{ - if [[ -r /etc/debian_chroot ]] ; then - local debchroot - debchroot="$(< /etc/debian_chroot)" - echo "(${debchroot})" - fi -} -LP_HOST="$(_chroot)" -unset _chroot +[[ -r /etc/debian_chroot ]] && LP_HOST="($(< /etc/debian_chroot))" # If we are connected with a X11 support -if [[ -n "$DISPLAY" ]] ; then +if [[ -n "$DISPLAY" ]]; then LP_HOST="${LP_COLOR_X11_ON}${LP_HOST}@${NO_COL}" else LP_HOST="${LP_COLOR_X11_OFF}${LP_HOST}@${NO_COL}"