5 while [ "${1:0:1}" = - ]; do
10 cmdline=("${cmdline[@]}" -ao oss:/dev/dsp1)
22 echo "usage: planime [QUAL] EPNUM" >&2
28 elif [ $# -eq 2 ]; then
33 if [ ! -r "$ep" ]; then
34 if [ -z "$qual" ]; then
35 ep="$(basename "$(pwd)") - ${ep}"
37 ep="$(basename "$(pwd)") ${qual} - ${ep}"
39 if [ -r "${ep}.ogm" ]; then
41 defopts=(-aid 1 -sid 0)
42 elif [ -r "${ep}.mkv" ]; then
44 defopts=(-slang eng -alang jpn)
45 elif [ -r "${ep}.mpg" ]; then
47 elif [ -r "${ep}.mp4" ]; then
49 elif [ -r "${ep}.avi" ]; then
54 if [ ! -r "$ep" ]; then
55 echo "no such episode: $ep" >&2
61 if [ -n "$savepar" ]; then
62 if [ -r "$ifile" ]; then
65 egrep -v "^${savepar}:" 0<&3 >"$ifile"
68 echo "$savepar: $saveval" >>"$ifile"
74 if [ -r "$ifile" ]; then
75 delay="`sed -n 's/delay *: *\([^ ]*\)$/\1/p' <"$ifile"`"
76 cmdline=("${cmdline[@]}" -delay "$delay")
78 cmdline=("${cmdline[@]}" "${defopts[@]}")
81 if [ "`hostname`" = pc6 ]; then chwp=y; fi
83 if [ "$chwp" = y ]; then (sleep 2; randomwp) & fi