#!/bin/bash cmd=$0 #player=mplayer.cutter-new # mplayer bin player=mplayer #vo=$1 #if [ -z "$1" ]; then # vo=xv #else # #shift #fi vo=xv while echo $1 | grep -q '^\-'; do echo "arg 1 is $1" echo "$1" | grep -q '^\-n' && delay=-n && shift # delay between echo "$1" | grep -q '^\-d' && del=-d && shift # query del files? echo "$1" | grep -q '^\-r' && recur=-r && shift # recursive dirs echo "$1" | grep -q '^\-' && op=$op"$1" && shift # general op done echo "del: $del delay: $delay recurse: $recur op:$op:" IFS=" " sleep 0.3 echo "Files are: $*" sleep 0.3 files=$* [ -z "$1" ] && files=`ls -1 $*` # | sed -e 's/^/"/' -e 's/$/"/'` echo files are $files #for i in `ls -1 $*`; do for i in $files; do echo ":: $i ::" if [ -n "$recur" -a -d "$i" ]; then echo "recursing into $i with cd $i; $cmd $op $del $recur *" (cd $i; echo $cmd $vo $op $del $recur * $cmd $op $del $recur * ) elif [ -f $i -o -p "$i" ] || echo $i | egrep -q '^(rtsp|http|mms)://' ; then echo "******************************************************************" echo $i echo "******************************************************************" [ -n "$delay" -a -z "$del" ] && sleep 0.3 again=a while [ "$again" = "a" ]; do [ "$del" != "-d" ] && again=0 echo $player -ao alsa -idx -vo $vo $op "$i" $player -ao alsa -idx -fs -vo $vo $op "$i" again="" if [ "$del" = "-d" ]; then echo echo -n "** D to del $i, M Move : " OIFS=$IFS IFS=" \ " read a b IFS=$OIFS echo "a is '$a', b is '$b'" case "$a" in D) echo "deleting $i" (rm $i; exit 0) ;; M) echo "moving $i to $b" (mv "$i" "$b"; exit 0) ;; a) again=$a ;; esac fi done fi done eval xset dpms $DPMS