Popup calendar using dzen

Version with hilights

#!/bin/bash
#
# pop-up calendar for dzen
#
# (c) 2007, by Robert Manea
#
 
TODAY=$(expr `date +'%d'` + 0)
MONTH=`date +'%m'`
YEAR=`date +'%Y'`
 
(
echo '^bg(grey70)^fg(#111111)'
date +'%A, %d.%m.%Y %H:%M'
 
# current month, highlight header and today
cal | sed -r -e "1,2 s/.*/^fg(white)&^fg()/" \
             -e "s/(^| )($TODAY)($| )/\1^bg(white)^fg(#111)\2^fg()^bg()\3/"
 
# next month, hilight header
[ $MONTH -eq 12 ] && YEAR=`expr $YEAR + 1`
cal `expr \( $MONTH + 1 \) % 12` $YEAR \
    | sed -e "1,2 s/.*/^fg(white)&^fg()/"
) \
    | dzen2 -p 60 -fn '-*-*-*-*-*-*-28-*-*-*-*-*-iso10646-*' -x 400 -y 60 -w 400 -l 18 -sa c -e 'onstart=uncollapse;button3=exit'

Simple version

#!/bin/bash
#
# pop-up calendar for dzen
#
# (c) 2007, by Robert Manea
#
 
TODAY=$(expr `date +'%d'` + 0)
MONTH=`date +'%m'`
YEAR=`date +'%Y'`
 
(echo '^fg(red)'`date +'%A, %d.%m.%Y %H:%M'`; \
echo; cal | sed -re "s/(^|[ ])($TODAY)($|[ ])/\1^bg(grey70)^fg(#111111)\2^fg()^bg()\3/"; \
[ $MONTH -eq 12 ] && YEAR=`expr $YEAR + 1`; cal `expr \( $MONTH + 1 \) % 12` $YEAR; \
sleep 60) | dzen2 -fn '-*-*-*-*-*-*-28-*-*-*-*-*-iso10646-*' -x 400 -y 60 -w 400 -l 18 -sa c -e 'onstart=uncollapse;button3=exit'
 
dzen/calendar.txt · Last modified: 2008/07/09 16:42 by shimuuar
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki