pastebin - collaborative debugging

pastebin is a collaborative debugging tool allowing you to share and modify code snippets while chatting on IRC, IM or a message board.

This site is developed to XHTML and CSS2 W3C standards. If you see this paragraph, your browser does not support those standards and you need to upgrade. Visit WaSP for a variety of options.

urukrama private pastebin - collaborative debugging tool What's a private pastebin?


Posted by Super Jamie on Sat 20 Dec 23:13
report abuse | View followups from Super Jamie | download | new post

  1. #!/bin/sh
  2. SERVICE='dzen2'
  3. if ps ax | grep -v grep | grep $SERVICE > /dev/null
  4.  then
  5. killall dzen2
  6.  else
  7. TODAY=$(expr `date +'%d'` + 0)
  8. MONTH=`date +'%m'`
  9. YEAR=`date +'%Y'`
  10. (echo '^bg(#111111)^fg(#3488DE)'`date +'%A %d %B %Y %n'`; echo
  11. \
  12. # current month, hilight header and today
  13. cal \
  14.     | sed -re 's/^/   /' | sed -re "s/^(.*[A-Za-z][A-Za-z]*.*)$/^fg(#3488DE)^bg(#111111)\1/;s/(^|[ ])($TODAY)($|[ ])/\1^bg(#3488DE)^fg(#111111)\2^fg(#6c6c6c)^bg(#111111)\3/"
  15.  
  16. # next month, hilight header
  17. [ $MONTH -eq 12 ] && YEAR=`expr $YEAR + 1`
  18. cal `expr \( $MONTH + 1 \) % 12` $YEAR \
  19.     | sed -re 's/^/   /' | sed -e 's/^\(.*[A-Za-z][A-Za-z]*.*\)$/^fg(#3488DE)^bg(#111111)\1/'
  20. ) \
  21.     | dzen2 -p -fg '#6c6c6c' -bg '#111111' -fn '-*-fixed-*-*-*-*-12-*-*-*-*-*-*-*' -x 1111 -y 730 -w 160 -l 18 -e 'onstart=uncollapse;key_Escape=ungrabkeys,exit'
  22. fi

Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:

To highlight particular lines, prefix each line with @@


Remember me so that I can delete my post