Ubuntu16.04 幻灯片桌面(系统自带)
找到图片文件夹然后
使用sh创建xml
#!/bin/sh
#xml文件名
xmlname="yzm-new.xml"
#壁纸目录
dir="/home/harold/桌面/wall/"
#持续时间
conTime=1795
#切换时间
chaTime=5
if [ ! -d $dir ];then
echo "error: $dir is not a dir!\b"
exit 0
fi
xmlname=${dir}${xmlname}
if [ -f $xmlname ];then
rm $xmlname
if [ ! $? -eq 0 ]; then
echo "error: $xmlname cant romove!\n"
exit 0
fi
fi
echo "\
<background>\n\
<starttime>\n\
<year>2009</year>\n\
<month>08</month>\n\
<day>04</day>\n\
<hour>00</hour>\n\
<minute>00</minute>\n\
<second>00</second>\n\
</starttime>\n\
<!-- This animation will start at midnight. -->\n" >> $xmlname
count=0
firstfile = ""
for file in `ls ${dir}*.jpg`
do
count=`expr $count + 1`
filename="$file"
if [ ! $count -eq 1 ];then
echo "\
<to>${filename}</to>\n\
</transition>\n" >> $xmlname
else
firstfile="$file"
fi
echo "\
<static>\
<duration>${conTime}</duration>\n\
<file>${filename}</file>\n\
</static>\n\
<transition>\n\
<duration>${chaTime}</duration>\n\
<from>${filename}</from>\n" >> $xmlname
echo "$count $filename done\n"
done
echo "\
<to>${firstfile}</to>\n" >> $xmlname
echo "</transition>\n</background>" >> $xmlname
echo "xml file make done\n"
第二步复制这个xml到后面写的位置usr/share/backgrounds/contest/
第三步到/usr/share/gnome-background-properties打开xenial-wallpapers.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE wallpapers SYSTEM "gnome-wp-list.dtd">
<wallpapers>
<wallpaper deleted="false">
<name>Ubuntu 16.04 Community Wallpapers</name>
<filename>/usr/share/backgrounds/contest/xenial.xml</filename>
<options>zoom</options>
</wallpaper>
<wallpaper deleted="false">
<name>IorinMoe</name>
<filename>/usr/share/backgrounds/contest/yizhimeng.xml</filename>
<options>zoom</options>
</wallpaper>
<wallpaper deleted="false">
<name>IorinMoenew</name>
<filename>/usr/share/backgrounds/contest/yzm-new.xml</filename>
<options>zoom</options>
</wallpaper>
增加新的主题,然后就完成了
来源:CSDN
作者:大翔神
链接:https://blog.csdn.net/qq_40743642/article/details/104220671