Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Highlight the current date on a GeekTool 'cal' geeklet' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Highlight the current date on a GeekTool 'cal' geeklet
Authored by: tangential on Nov 04, '09 04:40:00AM

The approach using the SMSO and RMSO strings is definitely better.

In my geektool setup, I use cal -y to show me the entire year.

Any ideas about highlighting the current date when a whole year is displayed would be appreciated.



[ Reply to This | # ]
Highlight the current date on a GeekTool 'cal' geeklet
Authored by: jonjlee on Dec 01, '09 02:27:42PM
This (rather ugly) awk-based command should do the trick:

cal -y | awk -v month="`date +%m`" -v day="`date +%e` " '{m=int((NR-3)/8)*3+1; for (i=0;i<3;i++) {t[i]=substr($0,1+i*22,20) " "; if (m+i==month) sub(day,"\033[0;31m&\033[0m",t[i]);} print t[0],t[1],t[2];}'
Change the highlight color using the values billr posted above.
Edited on Dec 01, '09 02:32:28PM by jonjlee


[ Reply to This | # ]