[bglug] Desktop Calendar

k|b|s kbs@bglug.it
Ven 19 Mar 2010 16:44:28 CET


Senza sprecare risorse per conky, gkrellm o widgets varie, mettiamo il
calendario sul wallpaper, ma prima formattiamolo alla joe's way:

Crea la directory ~/.wallpapers
Metti il tuo sfondo nella directory e chiamalo wall.png
Edita il crontab:
1 0 * * * LANG=it_IT /home/$user/bin/walldays
Salva in ~/bin/walldays :

----8<---- CUT HERE ----8<----
#!/bin/bash
# Time-stamp: <walldays, 19/3/2010 16:15:32 joe Exp>

rootdir="$HOME/.wallpapers"

font="DejaVuSans"
color="gray40"
colortday="#e9b569"
colorhigh="firebrick"
fsize="10"
rotate="270"
today=$(date +'%d')
todayfull=$(date +'%d %A')
month=$(date +'%B %Y' |tr 'a-z' 'A-Z')
pre="`cal | sed -e "1,2d;s/^ *//g;s/  / /g;s/ /\n/g" | tr '\n' ' '|awk -F "$today" '{print $1}'|tr ' ' '\n'`"
post="`cal | sed -e "1,2d;s/^ *//g;s/  / /g;s/ /\n/g" | tr '\n' ' '|awk -F "$today" '{print $2}'|sed 's/^ //'|tr ' ' '\n'`"

convert -pointsize "$fsize" -fill "$colortday" -background "$colorhigh" -rotate $rotate label:" $month " -background "transparent" -fill "$color" -font "$font" label:"$pre" -fill "$colortday" -background "$colorhigh" label:"$todayfull " -fill "$color" -background "transparent" label:"$post" -append "$rootdir"/days.png

composite -gravity center -geometry +600+0 "$rootdir"/days.png "$rootdir"/wall.png "$rootdir"/today.png

if [ $? ]; then
DISPLAY=:0.0 fbsetbg "$rootdir"/today.png
fi
----8<---- CUT HERE ----8<----

Screen: http://strop.ath.cx/shots/date.png

-- 
             ☿ ⚗ ☉
$(echo 1801614090P|dc)@bglug.it



Maggiori informazioni sulla lista bglug