background-1.xml文档的时候发愁了。。好多工作量啊,肿么办?
还是用脚本吧:
---------------------------------------------------------------------------
#!/bin/sh
echo "<background>"
echo "
<starttime>"
echo "
<year>2009</year>"
echo "
<month>08</month>"
echo "
<day>04</day>"
echo "
<hour>00</hour>"
echo "
<minute>00</minute>"
echo "
<second>00</second>"
echo "
</starttime>"
echo "<!-- This animation will start at midnight. -->"
num=1
#路径
mypicpath=/usr/share/backgrounds/mypic/
#多少张图片
maxnum=111
#显示时间
displaytime=595.0
#变换时间
changetime=5.0
echo "
<static>"
echo "
<duration>"$displaytime"</duration>"
echo "
<file>"$mypicpath""$num".jpg</file>"
echo "
</static>"
while [ "$num" -lt "$maxnum" ]
do
echo "
<transition>"
echo "
<duration>"$changetime"</duration>"
echo "
<from>"$mypicpath""$num".jpg</from>"
num=$(($num + 1))
echo "
<to>"$mypicpath""$num".jpg</to>"
echo "
</transition>"
echo "
<static>"
echo "
<duration>"$displaytime"</duration>"
echo "
<file>"$mypicpath""$num".jpg</file>"
echo "
</static>"
done
echo "</background>"
exit 0
将以上脚本保存成list文档,执行下面语句
chomd +x list
./list >
background-1.xml
然后将background-1.xml拷贝过去。。
但还是解放了。。。不用一个一个改了。。脚本无敌。。。。