Skip to content

Instantly share code, notes, and snippets.

@neerolyte
Created December 6, 2011 23:50
Show Gist options
  • Save neerolyte/1440668 to your computer and use it in GitHub Desktop.
Save neerolyte/1440668 to your computer and use it in GitHub Desktop.
dschoen@dave-xps 07 10:49:34 ~ 130
$ type prompt_command_lyte
prompt_command_lyte is a function
prompt_command_lyte ()
{
EXIT_STATUS="$?";
if [ $UID -eq 0 ]; then
FONT_USER=$FONT_RED;
else
FONT_USER=$FONT_GREEN;
fi;
if [ $EXIT_STATUS -eq 0 ]; then
STATUS='';
else
STATUS="$FONT_RED$EXIT_STATUS$FONT_END";
fi;
DATE=$(date "+%d %H:%M:%S");
PS1=$FONT_USER'\u@\h '$DATE' '$FONT_YELLOW'\w '$FONT_END$STATUS'\n\$ ';
prompt_command_title
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment