Colorful clock of Time

Please support our Shell Scripting advertiser: Programming Forums - DaniWeb Sister Site
Paul.Esson Paul.Esson is offline Offline Aug 8th, 2005, 4:03 am |
0
I know what your thinking, You and everyone else has always wanted a clock that sits at the top of your command prompt and tells you the time.

Why ?

I made this in first year when i spent countless hours programming and little in bed. I decided i needed somthing that told me all the things i needed to know in one easy location, the top of the screen.. So here it the pauls magical clock of sit on top of my screen.

Sorry about the lack of comments and meaningful varible names, its quite a hacked together little clock
Quick reply to this message  
Shell Scripting Syntax
  1. ------------------------------------------------------ To use this ---------------------------
  2. Replace 2352318 with your userid (thats my user ID on the box at uni)
  3.  
  4. add this to your ~/.bashrc
  5.  
  6. ------------------------------------------------------------------------------------------------
  7.  
  8. clock=()
  9. {
  10. LENGTH_STRING=27;
  11. MAILEXISTS=`ls /var/mail | grep -c 2352318`;
  12. if [ $MAILEXISTS -eq "1" ]; then
  13. MSGCOUNT=`grep -c "From " $MAIL`;
  14. else
  15. MSGCOUNT=0;
  16. fi;
  17. col=`tput cols`;
  18. tput sc;
  19. tput cup 0 $(( $col - LENGTH_STRING ));
  20. echo -e -n "\033[1;36m";
  21. echo -n " Mail:[$MSGCOUNT] [";
  22. date +"%H:%M] [%e/%b]";
  23. tput rc
  24. }
  25.  
  26. PROMPT_COMMAND="clock"
0
Mpiangu Mpiangu is offline Offline | Apr 12th, 2007
Good but i can't find bash soft ware to run it
 
 

Message:


Similar Threads
Thread Tools Search this Thread



Tag cloud for Shell Scripting
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC