| Bash Prompt HOWTO: $Revision: 0.100 $, $Date: 2009/08/07 02:33:22 $ | ||
|---|---|---|
| Prev | Chapter 11. Example Prompts | Next |
function proml {
local BLUE="\[\033[0;34m\]"
local RED="\[\033[0;31m\]"
local LIGHT_RED="\[\033[1;31m\]"
local WHITE="\[\033[1;37m\]"
local NO_COLOUR="\[\033[0m\]"
case $TERM in
xterm*|rxvt*)
TITLEBAR='\[\033]0;\u@\h:\w\007\]'
;;
*)
TITLEBAR=""
;;
esac
PS1="${TITLEBAR}\
$BLUE[$RED\D{%H%M}$BLUE]\
$BLUE[$LIGHT_RED\u@\h:\w$BLUE]\
$WHITE\$$NO_COLOUR "
PS2='> '
PS4='+ '
}

The lightweight proml prompt, showing time, username, machine name, and working directory in colour. It also modifies the title of the terminal.