blob: 3c67a8e9c4fde7f5639ae53dc43e9854b9a8b05c (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
#!/bin/sh
OLD_TODAY=0
while /bin/true
do
echo "^tw() ^fg(#ff0000)`date`"
TODAY=$(expr `date +'%d'` + 0)
if [ $TODAY -ne $OLD_TODAY ]
then
MONTH=$(date +'%_m')
YEAR=$(date +'%Y')
[ $MONTH -eq 12 ] && YEAR=$(($YEAR + 1))
OLD_TODAY=$TODAY
echo "^cs()"
if hash gcal 2>/dev/null; then
echo
gcal --cc-holidays=DE_BE --starting-day=Mon "${MONTH}" | sed "s/<\(\( \|[0-9]\)[0-9]\)>/ ^fg(#ff0000)\1^fg() /;s/:\(\( \|[0-9]\)[0-9]\):/ ^fg(#ffff00)\1^fg() /;/^[ \t]*$/d"
echo " "
gcal --cc-holidays=DE_BE --starting-day=Mon "$((($MONTH % 12) +1))" "$YEAR" | sed "s/<\(\( \|[0-9]\)[0-9]\)>/ ^fg(#ff0000)\1^fg() /;s/:\(\( \|[0-9]\)[0-9]\):/ ^fg(#ffff00)\1^fg() /;/^[ \t]*$/d"
else
echo
cal -m ${MONTH} | sed "s/$/ /;s/^\(.\{20\}\).*$/\1/" | sed -u -re "s/(^|[ ])($TODAY)($|[ ])/\1^fg(#ff0000)\2^fg()\3/"
echo " "
cal -m $((($MONTH % 12) +1)) $YEAR | sed "s/$/ /;s/^\(.\{20\}\).*$/\1/"
fi
fi
sleep 1
done
|