Saturday, September 09, 2006

Comics script (Front end)

file name:zcomics
this is just a zenity front-end to comic script
Updates: 13/Sep (debug)
#!/bin/bash
foo=`zenity --list --title="Which Comics?" --window-icon='question' --width=200 --height=280 --checklist --separator=' ' --column='Yeh?' --column="Comic" 'FALSE' 'garfeild' 'FALSE' 'calvin' 'FALSE' 'dilbert' 'FALSE' 'peanuts' 'FALSE' 'bornloser' 'FALSE' 'archie'`

(sh comics $foo)&

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

nautilus comix/

No comments: