This Geeklet displays a calendar of the current month, with today's date highlighted with ##. The font needs to be fixed width like Courier for it to display properly.


cal | sed "s/^/ /;s/$/ /;s/ $(date +%e) / $(date +%e | sed 's/./#/g') /"

Font: Courier Colour: White Size: 13


Geeklet files to download


User Avatar
monkeyslikebananas 3645 days ago
You can add the next month with:

cal -m ` echo `date +%m` + 1 | bc | sed 's/13/1/g'` | sed 's/^/ /g'
User Avatar
chris 3645 days ago

cal | perl -wne 'BEGIN{chomp($d = `date "+%e"`)} if (/^ *d/) {s/b$db/"#" x length($d)/e; s/d/ /g; s/#+/$d/g; print}'

Then colour date, and superimpose on simple cal.
User Avatar
Otaku 3463 days ago
the next month dose not work..

can anyone post how to add the next month underneath?

mac os x10.6.3
User Avatar
jqrd 3427 days ago
To add the next month, append the following:

; cal `date -v+1m "+%m"` `date -v+1m "+%Y"`

I added the previous month and the two next months:

cal `date -v-1m "+%m"` `date -v-1m "+%Y"` ; cal | sed "s/^/ /;s/$/ /;s/ $(date +%e) / $(date +%e | sed 's/./=/g') /" | sed "s/^ //;s/ $//" ; cal `date -v+1m "+%m"` `date -v+1m "+%Y"` ; cal `date -v+2m "+%m"` `date -v+2m "+%Y"`

A horizontal layout is proving difficult, though...
User Avatar
getheetoanunnery 3143 days ago
Did you ever find a horizontal layout solution? I'd really appreciate a fix.

I tweaked your code to add only the previous and next month, however instead of a " ## " marking the day, the current day is highlighted in red;

cal `date -v-1m "+%m"` `date -v-1m "+%Y"` ; cal | sed -E '1,$'"s/ ($(date +%e))( |$)/ $(echo '�33[1;31m')1$(echo  '�33[0m')2/" ; cal `date -v+1m "+%m"` `date -v+1m "+%Y"`

Log in to comment or register here.