Monday, October 09, 2006

Comics script (Front end) 2nd version





New: set the date




#!/bin/bash
foo=`zenity --list --title="Which Comics?" --window-icon='question' --width=200 --height=280 --checklist --separator=' ' --column='Yeh?' --column="Comic" 'FALSE' 'garfeild' 'FALSE' 'wizofid' 'FALSE' 'calvin' 'FALSE' 'dilbert' 'FALSE' 'peanuts' 'FALSE' 'bornloser' 'FALSE' 'archie'`
getdate=`zenity --calendar --title='which date' --date-format '%m%d'`

cd `dirname $0`
mv comix/*.* comix/archive
if test $getdate = `date +%m%d`
then
(sh comics $foo)&
else
(sh comics 'cal' $getdate $foo)&
fi

dcount=`echo $foo|wc -w`
fcount=`ls comix/|grep -E "(\.gif)$|(\.jpg)$"|wc -w`
mcount=`ls comix/|grep -E "(\.gif)$|(\.jpg)$"|wc -w`
tcount=$[ $fcount+$dcount ]
scount="0"
while [ $fcount -lt $tcount ];do fcount=`ls comix/|grep -E "(\.gif)$|(\.jpg)$"|wc -w`;sleep 1s;scount=$[ $fcount-$mcount ];echo $[ $[$scount*100]/$dcount];done|zenity --progress --percentage="0"
echo $foo

konqueror comix/





nautilus comix/

No comments: