Calendar (en)
From Conky PitStop
(Difference between revisions)
(→Option #1) |
(→Option #2) |
||
Line 68: | Line 68: | ||
''April 26th, 2009 at 06:29'' | ''April 26th, 2009 at 06:29'' | ||
- | That whole script can be replaced with: | + | That whole script can be replaced with: '''ncal -C -h''' | works here too after a fashion, horizontal spacing is strange |
${color 888888}${font LCDMono:bold:size=12}${execpi 60 DJS=`date +%_d`; cal | sed '1d' | sed '/./!d' | sed 's/$/ /' | fold -w 21 | sed -n '/^.\{21\}/p' | sed 's/^/${alignc} /' | sed /" $DJS "/s/" $DJS "/" "'${color2}'"$DJS"'${color 888888}'" "/} | ${color 888888}${font LCDMono:bold:size=12}${execpi 60 DJS=`date +%_d`; cal | sed '1d' | sed '/./!d' | sed 's/$/ /' | fold -w 21 | sed -n '/^.\{21\}/p' | sed 's/^/${alignc} /' | sed /" $DJS "/s/" $DJS "/" "'${color2}'"$DJS"'${color 888888}'" "/} |
Revision as of 13:15, 1 November 2012
Calendar
Language | English Français |
Option #1
In Spacing, I showed you two lines that put a calendar into my conky that uses the calendario.sh script.
Those lines:
${font LCDMono:size=19}${color2}${pre_exec ~/Conky/scripts/calendario.sh semana} ${color 888888}${pre_exec ~/Conky/scripts/calendario.sh pasado}${color2}${pre_exec ~/Conky/scripts/calendario.sh hoy}${color 888888}${pre_exec ~/Conky/scripts/calendario.sh futuro}${font}
UPDATE: Thanks to stinkeye. 'cal' started acting funny a while back. stinkeye has a fix, where the script uses "cal |" make these changes:
Start on Monday:
ncal -M -C -h |
Start on Sunday:
ncal -C -h |
And the calendario.sh script - with ncal:
#! /bin/sh # written by: jjgomera # # ncal by stinkeye #Start on Monday: # ncal -M -C -h | #Start on Sunday: # ncal -C -h | #str=`echo '\033[01;32m29'` # original comment for "cal" # replace the 4 "cal |" with "cal -m |" to have the week start on Monday DATE=`date | awk -F" " '{print $3}'` case "$1" in mes) ncal -C -h | head -n1 ;; semana) ncal -C -h | head -n2 | tail -n1 ;; pasado) ncal -C -h | grep -v '[a-zA-Z]' | grep '[0-9]' | awk -F$DATE ' BEGIN {i=0} ($1 == $0 && i==0) {print $1}($1 != $0 && i==0){i=i+1;print $1}'; ;; hoy) echo $DATE; ;; futuro) ncal -C -h | grep -v '[a-zA-Z]' | grep '[0-9]' | awk -F$DATE ' BEGIN {i=1} (i==0) {print $0}($1 != $0 && i==1){i=i-1;print $2}'; ;; esac
Now make that “executable” and conky can use it.
Option #2
Crinos512
April 26th, 2009 at 06:29
That whole script can be replaced with: ncal -C -h | works here too after a fashion, horizontal spacing is strange
${color 888888}${font LCDMono:bold:size=12}${execpi 60 DJS=`date +%_d`; cal | sed '1d' | sed '/./!d' | sed 's/$/ /' | fold -w 21 | sed -n '/^.\{21\}/p' | sed 's/^/${alignc} /' | sed /" $DJS "/s/" $DJS "/" "'${color2}'"$DJS"'${color 888888}'" "/}
I can’t claim to have crafted that code, but I wish I could and it looks like: