This is a wrapper I use to play media files. If I quit I can restart, a big plus.
#!/bin/bash
# Title......: sm
# Description: show media
# Author.....: Mitchell Johnston - uid 0
# Contact....: mxj_97@yahoo.com
#----------------------------------
# variables
#----------------------------------
LOG=/var/tmp/$(basename $@).out
# functions
#----------------------------------
xtitle() ## sets window title
{
printf "\033]0; [$*] \007"
}
# main
#---------------------------
[ ! -f $@ ] && cd ~/videos # if no args go to main video directory
xtitle $(basename $1) # set title to file being played
if [ -f $LOG ] # if it has been played before restart at quit point
then
END=$(strings $LOG|tail -4|head -1 | cut -d: -f2|cut -dV -f1)
mplayer -ss $END -msgcolor -use-filename-title -softvol -softvol-max 300 -vo xv $@ | tee $LOG
else
mplayer -msgcolor -use-filename-title -softvol -softvol-max 300 -vo xv $@ | tee $LOG
fi
## removes files and log
echo -n "Delete $1 ? "
read ANS
if [ "$ANS" == "y" ]
then
\rm $1 $LOG
else
echo -n "Delete $LOG ? "
read ANS2
[ "$ANS2" == "y" ] && \rm $LOG
fi
[ -f $1 ] && ls -l $1
[ -f $LOG ] && ls -l $LOG
clear; vids . # This is another script that lists media files w/ play time
Let me know if you find this of use, or have questions.
bd - If you are going to tell people the truth, you had better make them laugh or they will kill you. --Oscar Wilde