22 Mar 2006 yeupou   » (Master)

Looking for a nice shell prompt? Add the following in your .bashrc:

red='\[\033[0;31m\]'
RED='\[\033[1;31m\]'
green='\[\033[0;32m\]'
GREEN='\[\033[1;32m\]'
yellow='\[\033[0;33m\]'
YELLOW='\[\033[1;33m\]'
blue='\[\033[0;34m\]'
BLUE='\[\033[1;34m\]'
magenta='\[\033[0;35m\]'
MAGENTA='\[\033[1;35m\]'
cyan='\[\033[0;36m\]'
CYAN='\[\033[1;36m\]'
grey='\[\033[0;37m\]'
GREY='\[\033[1;30m\]'
NC='\[\033[0m\]'

showuser='' if [ "`id -u`" != 0 ]; then showuser="\u@"; fi

hostnamecontent=`cat /etc/hostname` showchroot='' if [ "$hostnamecontent" != $HOSTNAME ]; then showchroot="*$hostnamecontent"; fi

PS1="${yellow}\$(date +%H:%M),\! ${cyan}${showuser}\h${showchroot}:${green}\w${NC}\n ${grey}"'\$'"${NC} "

# Define a nice correct PROMPT_COMMAND, which will update to window title, # only if we have an X terminal case $TERM in aterm|eterm|*xterm|konsole|kterm|rxvt|wterm) PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME%%.*}${showchroot}: ${PWD/$HOME/~}\007"' esac

Latest blog entries     Older blog entries

New Advogato Features

FOAF updates: Trust rankings are now exported, making the data available to other users and websites. An external FOAF URI has been added, allowing users to link to an additional FOAF file.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!