Image 01
profile-image

jaimevalero

Jaime Valero , Spain
Movie-Selector

Video Apps by TOD 4 comments

Thx to you. That was my first try, now I think I can contribute in bigger projects here at the Linux world.

Any sugerences ? - Nov 24 2005
Movie-Selector

Video Apps by TOD 4 comments

It seems a great idea a movie selector app, but I dont like to enter the paths of my entire simpsons collections manually.
So I wrote an update of the script.

For using it:
Just change the path where your videos are. (VIDEO_PATH) and the extension of your videos (VIDEO_EXTENSION)


I hope you will find useful too!






##################################
#!/bin/bash



#INSERT HERE YOUR VIDEO PATH
VIDEO_PATH=/mnt/descargado/bajados
#INSERT HERE THE EXTENSION FOR THE VIDEOS
VIDEO_EXTENSION=avi

#NAME OF THE TEMP_FILE TO EXECUTE
TEMPFILE=/tmp/parte




# Remove temporal files
rm $TEMPFILE



echo "set -xv ">> $TEMPFILE

echo "#\!/bin/bash ">> $TEMPFILE
echo "# Führt vordefinierte Befehle aus. ">> $TEMPFILE
echo "# Temporäre Datei für die Ergebnisse ">> $TEMPFILE

echo "">> $TEMPFILE

echo "tempdatei=/tmp/etmov.tmp.\$\$ ">> $TEMPFILE

# Dialogfenster
echo "Xdialog --backtitle ET-Moviselektor --title "Play your Video" --menu "Wählen das Video" 0 0 0 \\" >> $TEMPFILE


for i in ${VIDEO_PATH}/*.${VIDEO_EXTENSION}; do
if test -f "$i"; then
J=`expr $J + 1`
echo -n $J \" `basename "$i"` \" \\ >> $TEMPFILE


fi

done
J=`expr $J + 1`
echo $J \"\" \\ >> $TEMPFILE


echo "2> \$tempdatei " >> $TEMPFILE


echo "eingabe=\$(cat \$tempdatei) " >> $TEMPFILE

echo "#Auswerten " >> $TEMPFILE

echo "echo \"Sie haben ausgewählt: \$eingabe\" " >> $TEMPFILE



echo " case \$eingabe in " >> $TEMPFILE


# The case structure

for i in ${VIDEO_PATH}/*.${VIDEO_EXTENSION}; do
if test -f "$i"; then
echo " " >> $TEMPFILE
K=`expr $K + 1`
echo -n $K\) \# >> $TEMPFILE
echo " " >> $TEMPFILE
echo xine \"$i\" >> $TEMPFILE
echo \;\; >> $TEMPFILE
#echo " " >> $TEMPFILE

fi
done


echo esac >> $TEMPFILE

# Aufräumen
echo "rm -f \$tempdatei " >> $TEMPFILE


# Dialogfenster

#echo "$J \"\" \ ">> $TEMPFILE
echo "2> \$tempdatei ">> $TEMPFILE

# Execute the file we have created
sh $TEMPFILE

rm $TEMPFILE


exit - Nov 23 2005