config_files/conky/scripts/calendar.sh

32 lines
930 B
Bash
Executable File

#!/bin/bash
#
# pop-up calendar for dzen
#
# based on (c) 2007, by Robert Manea
# http://dzen.geekmode.org/dwiki/doku.php?id=dzen:calendar
# modified by urukrama
#
TODAY=$(expr `date +'%d'` + 0)
MONTH=`date +'%m'`
YEAR=`date +'%Y'`
(
echo '^bg(#000000)^fg(#FFFFFF)'`date +'%A %d %B %Y %n'`; echo
\
# current month, hilight header and today
cal \
| sed -re "s/^(.*[A-Za-z][A-Za-z]*.*)$/^fg(#B23308)^bg(#000000)\1/;s/(^|[ ])($TODAY)($|[ ])/\1^bg(#B23308)^fg(#000000)\2^fg(#FFFFFF)^bg(#000000)\3/"
# next month, hilight header
#[ $MONTH -eq 12 ] && YEAR=`expr $YEAR + 1`
#cal `expr \( $MONTH + 1 \) % 12` $YEAR \
# | sed -e 's/^\(.*[A-Za-z][A-Za-z]*.*\)$/^fg(#B23308)^bg(#000000)\1/'
sleep 8
) \
| dzen2 -fn '-misc-fixed-*-*-*-*-10-*-*-*-*-*-*-*' -x 1120 -y 15 -w 160 -l 9 -sa c -e 'button3=exit;button1=exit;onstart=uncollapse;'-
#-artwiz-nu-medium-r-normal--11-110-75-75-p-90-iso8859-1
#-fg '#F2EDD7' -bg '#000000'