From 311356df14662edce3c855fec1b9b5daad516be7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Thu, 2 May 2019 09:51:43 +0200 Subject: shellrc: add color prompt --- shellrc/files/profile.prompt.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 shellrc/files/profile.prompt.sh (limited to 'shellrc/files') diff --git a/shellrc/files/profile.prompt.sh b/shellrc/files/profile.prompt.sh new file mode 100644 index 0000000..122a35b --- /dev/null +++ b/shellrc/files/profile.prompt.sh @@ -0,0 +1,12 @@ +# Better prompt +case "$TERM" in + xterm*|rxvt*) + export PS1='$(EC=$? +[ $EC = 0 ] || echo -n "\e[1;33m($EC) " +if [ `id -u` -eq "0" ]; then + echo -n "\[\e[1;31m\]\u@\h:\[\e[1;34m\]\W\[\e[1;31m\]\$\[\e[0m\] " +else + echo -n "\[\e[1;32m\]\u@\h:\[\e[1;34m\]\W\[\e[1;32m\]\$\[\e[0m\] " +fi)' + ;; +esac -- cgit v1.2.3