#!/bin/bash # Make a new wallpaper #set -x FONT=Delirium-Regular TMP=`mktemp` MONTH=`date -d "next month" "+%m %Y"`; cal $MONTH > $TMP TITLE=`cat $TMP|head -n 1` convert -size 700x100 xc:transparent -font $FONT -pointsize 32 -annotate +30+30 "$TITLE" $TMP.png gimp --batch-interpreter plug-in-script-fu-eval -i -d -b '(script-autocrop "'$TMP.png'")' -b '(gimp-quit 0)' >> /dev/null 2>&1 mogrify -bordercolor transparent -border 10 $TMP.png grep -v "$TITLE" $TMP > $TMP.tmp mv $TMP.tmp $TMP #Do something {{{ CHANGE_CHAR () { if [ "$CHAR" == "sp" ] then CHAR="" fi if [ "$CHAR" == "nl" ] then CHAR="" fi } # /* }}} */ # Make the individual files {{{ INDIVIDUAL () { CHARCOUNT="1" for CHAR in `od -An -av $TMP` #for CHAR in `cat $TMP` do printf "$CHAR \r" CHANGE_CHAR let COUNT=$COUNT+1 FILE=`printf %03d $COUNT`.png if [ "$CHAR" == "" ] then convert -size 1x1 xc:transparent $FILE else convert -size 100x100 xc:transparent -font $FONT -pointsize 32 -annotate +30+30 "$CHAR" $FILE gimp --batch-interpreter plug-in-script-fu-eval -i -d -b '(script-autocrop "'$FILE'")' -b '(gimp-quit 0)' >> /dev/null 2>&1 mogrify -bordercolor transparent -border 2 $FILE fi done } # }}} INDIVIDUAL # #set -x LINE=`cat $TMP|wc -c` COUNT=0 while [ "$COUNT" -lt "$LINE" ] do FILES="" for CAR in `seq 3` do let COUNT=$COUNT+1 FILE=`printf %03d $COUNT`.png FILES="$FILES $FILE" done # Turn each 3 into 1 let MONT=$MONT+1 montage $FILES -tile 3x1 -mode concatenate -background transparent mont_`printf %02d $MONT`.png done montage m*.png -tile 7x -geometry -2-2 -background transparent calendar.png montage $TMP.png calendar.png -tile 1x2 -mode concatenate -background transparent 00cal.gif rm $TMP* *.png