1 Star 0 Fork 0

优麒麟 / ubuntukylin-wallpapers

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
update-background.py 822 Bytes
一键复制 编辑 原始数据 按行查看 历史
#!/usr/bin/env python3
import glob
PREAMBLE = """<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. -->
"""
ENTRY = """ <static>
<duration>1795.0</duration>
<file>%(a)s</file>
</static>
<transition>
<duration>5.0</duration>
<from>%(a)s</from>
<to>%(b)s</to>
</transition>
"""
FOOTER = """</background>
"""
PATH='/usr/share/backgrounds/'
def main():
images = glob.glob('*.jpg')
m = len(images)
output = ''
output += PREAMBLE
for i in xrange(m):
output += ENTRY % {'a': PATH + images[i], 'b': PATH + images[(i+1) % m]}
output += FOOTER
print output,
if __name__ == '__main__':
main()
1
https://gitee.com/ubuntukylin/ubuntukylin-wallpapers.git
git@gitee.com:ubuntukylin/ubuntukylin-wallpapers.git
ubuntukylin
ubuntukylin-wallpapers
ubuntukylin-wallpapers
master

搜索帮助