Originally Posted by
searchOne
Code:
${execpi 60 DJS=`date +%_d`; cal | sed '/./!d' | sed 's/$/ /' | fold -w 21 | sed -n '/^.\{21\}/p' | sed 's/^/${alignc} /' | sed /" $DJS "/s/" $DJS "/" "'${color orange}'"$DJS"'${color}'" "/}
Originally Posted by
inigo48
Thank you searchOne!
It is perfect =D>
It isn't too important, but is it possible to change the calendar without much work to start the weak with Monday? (I know the ${exec cal -m} does this with the simple calendar) edit: OK, I realised I just have the add the -m to your line. so it is solved
and my new calendar is even better than the old one
I've been using that for while with a bit of editing.
You can also do this to make the Month and year and the days of the week different colors from the rest:
Code:
${execpi 3600 DAY=$(date '+%_d');cal=$(cal);echo -e "\${color cccccc}${cal:0:21}\${color 0000cc}${cal:21:21}\${color}$(echo "${cal:42}" | sed -e '/^ *$/d' -e 's/^/ /' -e 's/$/ /' -e /" $DAY "/s/" $DAY "/" "'${color ffffff}'"$DAY"'${color}'" "/ -e 's/^ //' -e 's/ $//')"}
To fill in the blank areas at the beginning and end of the month it gets a bit more complicated:
Code:
${execpi 3600 date=$(date '+%F');DAY=${date:8:2};DAY=${DAY/#0/};cal=$(cal);prev=$(cal $(date '+%-m %Y' --date="${date:0:7}-15 -1 month")|sed 's/ *$//;/^$/d'|tail -1);next=$(cal $(date '+%-m %Y' --date="${date:0:7}-15 +1 month")|sed '/^ *&/d;1,2d;s/^ *//'|head -1);if [ ${#next} == 19 ] ;then next=$'\n'"\${color9} $next";else next="\${color9} $next";fi;if [ ${#prev} == 20 ]; then prev="$prev"$'\n ';else prev="$prev ";fi;echo -e "\${color7}${cal:0:21}\${color4}${cal:21:21}\${color9}$prev\${color}$(echo "${cal:42}" | sed -e '/^ *$/d' -e 's/^/ /' -e 's/$/ /' -e 's/^ *1 / 1 /' -e /" $DAY "/s/" $DAY "/" "'${color3}'"$DAY"'${color}'" "/ -e 's/^ //' -e 's/ *$//')$next"}
So it looks like this:
screenshot2009-12-20T16:13:48-0500.png
You can add |sed 's/^/${alignc}/' before the final } to center align or |sed 's/^/${alignr}/' for right alignment.
A slightly neater version of the "script" is here.
Bookmarks