mirror of
https://github.com/NaomiAmethyst/dots.git
synced 2025-04-13 09:30:06 +00:00
25 lines
476 B
Text
25 lines
476 B
Text
![]() |
function do_prompt ()
|
||
|
{
|
||
|
if [ $? -ne 0 ] ; then
|
||
|
local ERROR_PROMPT="\[\033[01;31m\]"
|
||
|
fi
|
||
|
|
||
|
local BASE
|
||
|
if [ $UID -ne 0 ] ; then
|
||
|
BASE="$"
|
||
|
else
|
||
|
BASE="#"
|
||
|
fi
|
||
|
case $TERM in
|
||
|
xterm*)
|
||
|
TITLEBAR='\[\033]0;\u@\h:\w\007\]'
|
||
|
;;
|
||
|
*)
|
||
|
TITLEBAR=''
|
||
|
;;
|
||
|
esac
|
||
|
export PS1="${TITLEBAR}\[\033[01;32m\]\u@\h \[\033[01;34m\]\w ${ERROR_PROMPT}${BASE} \[\033[00m\]"
|
||
|
}
|
||
|
|
||
|
PROMPT_COMMAND=do_prompt
|