04.08.2009Die Fliege…
02.08.2009Make ya Prompt sexy!
There literally is a thousand ways to make your prompt look nice. I just found one, that makes your prompt smile if the last command succeeded and look sad in case the command was invalid.
Here you can see what I mean:

In case you liked that, here’s the command:
1 | PS1="\u@\h:\w \`if [[ \$? = 0 ]]; then echo \[\033[01\;32m\]\\\:\\\)\[\033[00m\]; else echo \[\033[01\;31m\]\\\:\\\(\[\033[00m\]; fi\` " |
This sets your $PS1 environment variable like this:
PS1 = user@host:workingDir exec( if(last return value == 0) then echo
else echo
)
The \[}033… stuff is there for the colors, the \\\:\\\) is an escaped smiley. This way the shell does not interpred the : and the ) characters.
You can just paste it in you terminal and try it out for the session, or edit your .bashrc (in case you use the BASH)
Anyway, hope you enjoy






