calendar snippets

OSD calendar script

Tagged osd, on screen display, calendar, linux, osd_cat, cal  Languages bash

Hook this script to your favourite keybinding to get an OSD calendar on your screen. The calendar modification used was found here.

month=date "+%m" 
cal_head=cal -m $month | head -1 
cal_tail=cal -m $month | tail -7
today=date "+%e"| sed 's/^ *//;s/ *$//'
cal+=$(echo -en "${cal_tail/${today}/*${today}}\n")
$(echo -e "$cal" | osd_cat -c white -l 8 -i 10 -o 10 -f $font -p bottom -A right -s 1)

This is how I hooked it to Mod+c in dwm.


// ... abbreviated
static const char *calcmd[]  = { "",NULL };
static Key keys[] = {
// ...abbr
{ MODKEY,                       XK_c,      spawn,          {.v = calcmd } },
// ...abbr
// ... abbreviated