From 92d067f3b5328f019d180b4a3797856de453127d Mon Sep 17 00:00:00 2001 From: Vincent Le Gallic Date: Fri, 26 Jul 2013 00:34:49 +0200 Subject: [PATCH] =?utf8?q?Affichage=20du=20message=20de=20d=C3=A9but=20*ap?= =?utf8?q?r=C3=A8s*=20le=20sourcing=20du=20.bashrc.local?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .bashrc | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/.bashrc b/.bashrc index 3b798d3..8d6f548 100644 --- a/.bashrc +++ b/.bashrc @@ -233,26 +233,25 @@ PROMPT_COMMAND=prompt_command # | Messages au début | # +-------------------+ -if [[ $(uname) == Linux && ( $(locale charmap) == UTF-8 && $TERM != screen ) ]]; then - MINUS_CHAR=─ - gen_minus_line - date=$(/bin/date +"%R, %A %d %B %Y") - redate=${date//é/e} - redate=${redate//û/u} - if [ "$color_prompt" = yes ]; then - echo -e "${line_color}┬─${redate//?/─}─┬${MINUS_LINE:${#date}-18}\n\ -│ ${announce_date_color}$date ${line_color}│\n\ -└─${redate//?/─}─┘\e[0m\n" +function welcome_message () +{ + if [[ $(uname) == Linux && ( $(locale charmap) == UTF-8 && $TERM != screen ) ]]; then + MINUS_CHAR=─ + gen_minus_line + date=$(/bin/date +"%R, %A %d %B %Y") + redate=${date//é/e} + redate=${redate//û/u} + if [ "$color_prompt" = yes ]; then + echo -e "${line_color}┬─${redate//?/─}─┬${MINUS_LINE:${#date}-19}\n│ ${announce_date_color}$date ${line_color}│\n└─${redate//?/─}─┘\e[0m\n" + else + echo -e "┬─${redate//?/─}──┬${MINUS_LINE:${#date}-18}\n│ $date │\n└─${redate//?/─}──┘\n" + fi + unset date else - echo -e "┬─${redate//?/─}──┬${MINUS_LINE:${#date}-18}\n\ -│ $date │\n\ -└─${redate//?/─}──┘\n" + MINUS_CHAR=- + gen_minus_line fi - unset date -else - MINUS_CHAR=- - gen_minus_line -fi +} ### ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ### ### Attention à ce que vous avez édité dans cette section ### @@ -307,3 +306,6 @@ if [ -f ~/.bash_aliases_local ]; then . ~/.bash_aliases_local fi +# On n'exécute le welcome_message que à ce moment, parce que la customisation +# local a pu changer des couleurs +welcome_message -- 2.39.2