summaryrefslogtreecommitdiff
path: root/shellrc/prompt.sh
diff options
context:
space:
mode:
Diffstat (limited to 'shellrc/prompt.sh')
-rwxr-xr-xshellrc/prompt.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/shellrc/prompt.sh b/shellrc/prompt.sh
new file mode 100755
index 0000000..7a857da
--- /dev/null
+++ b/shellrc/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