| Bash Prompt HOWTO: $Revision: 0.89 $, $Date: 2001/08/22 00:57:34 $ | ||
|---|---|---|
| Prev | Chapter 12. 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\$(date +%H%M)$BLUE]\
$BLUE[$LIGHT_RED\u@\h:\w$BLUE]\
$WHITE\$$NO_COLOUR "
PS2='> '
PS4='+ '
}
|
![[1745][giles@zinfandel:~/bin]$](proml.png)
The lightweight proml prompt, showing time, username, machine name, and working directory in colour. It also modifies the title of the terminal.