Current calendar week on Desktop


This should say all:

Calendar-Desktop
Your next week calendar as Desktop background.

This is a hack. The script opens Sunbird (which you configured before), takes a screen shot of the window, closes Sunbird, cuts away the borders of the image and sets it as GNOME desktop background.

You will have to edit the pixels to cut off (depending on your theme).

#!/bin/bash
#TEXT="2 Friday"
TEXT="Friday" # next friday, so on saturday we see the next week
TOP=176   # in px
LEFT=112
BOTTOM=26
RIGHT=18
BACKGROUND='#76848F'
DATE=$(date --date="$TEXT" "+%m/%d/%Y")
WEEK=$(date --date="$TEXT" "+%-V")
FILENAME="$HOME/current-calendar.png"
TITLE="Week $WEEK - Sunbird"
killall sunbird-bin 2>/dev/null
sunbird -showdate "$DATE" 2>&1 &
# mozilla is slooow...
sleep 20
#import -crop "+$TOP+$LEFT" -window "$TITLE" $FILENAME
#import -crop "+$TOP+$LEFT" -rotate 10 -window "$TITLE" $FILENAME
#import -crop "+$TOP+$LEFT" -rotate 10 -monochrome -window "$TITLE" $FILENAME
import -crop "+$TOP+$LEFT" -window "$TITLE" - |
convert - -gravity NorthWest -crop "-$RIGHT-$BOTTOM" -colorspace Gray - |
convert - -colorspace RGB -background "$BACKGROUND" -rotate -10 $FILENAME
killall sunbird-bin
which gconftool   2>/dev/null >/dev/null && GCT=gconftool
which gconftool-2 2>/dev/null >/dev/null && GCT=gconftool-2
$GCT --type=string --set /desktop/gnome/background/picture_filename "$FILENAME"
wait 

Also see MDC Command Line Options

  1. No comments yet.
(will not be published)

  1. No trackbacks yet.