{"id":16,"date":"2011-12-03T09:21:26","date_gmt":"2011-12-03T08:21:26","guid":{"rendered":"http:\/\/www.schmidt-welt.net\/weblog\/?p=16"},"modified":"2012-10-22T21:56:47","modified_gmt":"2012-10-22T20:56:47","slug":"geektool-calendar-view","status":"publish","type":"post","link":"https:\/\/www.schmidt-welt.net\/weblog\/geektool-calendar-view\/","title":{"rendered":"GeekTool calendar view"},"content":{"rendered":"<p style=\"text-align: left\">With this command you will see the calendar with first day monday.<\/p>\n<p><code>echo `date \"+%d %B %Y\"` |  cal | awk '{ getline; print \" Mo Di Mi Do Fr Sa So\"; getline; if (substr($0,1,2) == \" 1\")  print \"                    1 \"; do { prevline=$0; if (getline == 0) exit; print \" \" substr(prevline,4,17) \" \" substr($0,1,2) \" \"; } while (1) }' | awk -v cday=`date \"+%d\"` '{ fill=(int(cday)&gt;9?\"\":\" \"); a=$0; sub(\" \"fill int(cday)\" \",\"(\"fill int(cday)\")\",a); print  a }'<\/code><\/p>\n<p>Update: I have changed the command to: <\/p>\n<p><code>cal | awk '{ getline; print \" Mo Di Mi Do Fr Sa So\"; getline; if (substr($0,1,2) == \" 1\") print \"                    1 \"; do { prevline=$0; if (getline == 0) exit; print \" \" substr(prevline,4,17) \" \" substr($0,1,2) \" \"; } while (1) }' | awk -v cday=`date \"+%d\"` '{ fill=(int(cday)>9?\"\":\" \"); a=$0; sub(\" \"fill int(cday)\" \",\"(\"fill int(cday)\")\",a); print a }'<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>With this command you will see the calendar with first day monday. echo `date &#8220;+%d %B %Y&#8221;` | cal | awk &#8216;{ getline; print &#8221; Mo Di Mi Do Fr Sa So&#8221;; getline; if (substr($0,1,2) == &#8221; 1&#8243;) print &#8221; 1 &#8220;; do { prevline=$0; if (getline == 0) exit; print &#8221; &#8221; substr(prevline,4,17) &#8221; [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-16","post","type-post","status-publish","format-standard","hentry","category-allgemein"],"_links":{"self":[{"href":"https:\/\/www.schmidt-welt.net\/weblog\/wp-json\/wp\/v2\/posts\/16","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.schmidt-welt.net\/weblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.schmidt-welt.net\/weblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.schmidt-welt.net\/weblog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.schmidt-welt.net\/weblog\/wp-json\/wp\/v2\/comments?post=16"}],"version-history":[{"count":3,"href":"https:\/\/www.schmidt-welt.net\/weblog\/wp-json\/wp\/v2\/posts\/16\/revisions"}],"predecessor-version":[{"id":20,"href":"https:\/\/www.schmidt-welt.net\/weblog\/wp-json\/wp\/v2\/posts\/16\/revisions\/20"}],"wp:attachment":[{"href":"https:\/\/www.schmidt-welt.net\/weblog\/wp-json\/wp\/v2\/media?parent=16"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.schmidt-welt.net\/weblog\/wp-json\/wp\/v2\/categories?post=16"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.schmidt-welt.net\/weblog\/wp-json\/wp\/v2\/tags?post=16"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}