Нагуглил http://ubuntuforums.org/showthread.php?t=1329147#3 - там описан .xml файл задающий слайдшоу.
Час помучавшись с консолью, погуглив и почитав мануалы (я искал $PWD, учился создавать массивы и т.д.), я написал скрипт, создающий необходимый xml-файл.
Ссылка для скачки скрипта
#!/bin/bash
case $1 in
pwd) dir=$PWD; 3=$2;;
nml) dir=$2;;
*) echo "Usage: $0 [type [dir]] [output xml-filename].
Types:
pwd - Create xml file using jpg-files in current directory
nml - Create xml file using jpg-files in specified directory
Examples:
$0 pwd myslideshow
$0 nml /home/user/pictures/ mypictures"; exit;;
esac
rm $3.xml
cat > $3.xml << EOF
<background>
<starttime>
<year>2009</year>
<month>08</month>
<day>04</day>
<hour>00</hour>
<minute>00</minute>
<second>00</second>
</starttime>
<!-- This animation will start at midnight. -->
EOF
for image in $dir/*.jpg; do
IMAGES+=( $image )
done
IMAGEScount=${#IMAGES}
for ((i=0;i<$IMAGEScount;i++)); do
echo ${IMAGES[${i}]}
done
for ((i=0;i<$IMAGEScount;i++)); do
n=$i+1
cat >> $3.xml << EOF
<static>
<duration>595.0</duration>
<file>${IMAGES[${i}]}</file>
</static>
<transition>
<duration>5.0</duration>
<from>${IMAGES[${i}]}</from>
<to>${IMAGES[${n}]}</to>
</transition>
EOF
done
cat >> $3.xml << EOF
</background>
EOF
Комментариев нет :
Отправить комментарий