#!/bin/sh # # Shell script for downloading photos using KDE. # # Copyright 2005 Matthew Steven http://www.matts.org/ # You may feel free to use it for personal use only under the terms of the GNU GPL # a copy of which can be found at http://gnu.org/copyleft/gpl.html # Set this to the folder (relative to home) that you want to download photos into PHOTODIR='Pictures' COUNT=0 DATEIS=`date --iso-8601=date` if [ -e /dev/camera ] ; then mount /mnt/camera 2>&1 CNT=`ls /mnt/camera/dcim/*nikon/|wc -l` CURCNT=0 DR=`kdialog --title "Photo Download" --progressbar "Downloading Photos..." ${CNT}` while [ -d "${HOME}/${PHOTODIR}/${DATEIS}_${COUNT}" ]; do COUNT=`echo ${COUNT} + 1|bc` done; DATEIS="${DATEIS}_${COUNT}" cd ${HOME}/${PHOTODIR} mkdir ${HOME}/${PHOTODIR}/${DATEIS} for i in `ls /mnt/camera/dcim/*nikon/`; do cp /mnt/camera/dcim/*nikon/$i ${HOME}/${PHOTODIR}/${DATEIS}/ convert -geometry 800x600 ${HOME}/${PHOTODIR}/${DATEIS}/$i ${HOME}/${PHOTODIR}/${DATEIS}/s_$i CURCNT=`echo ${CURCNT} + 1 | bc`; dcop $DR setProgress ${CURCNT} done sync; sync; sleep 2s; dcop $DR close umount /mnt/camera kfmclient openURL file://${HOME}/${PHOTODIR}/${DATEIS} 2>&1>/dev/null else echo "No camera detected at /dev/camera" kdialog --sorry "No camera detected! Make sure it is plugged in AND turned on then try again." fi