为动态gnome墙纸生成xml文件的简单实用程序命令行
gnome-background-generator的Python项目详细描述
这个软件包提供了两种自动动态更改桌面的方法。 一种是生成一个XML文件,供GNOME系统使用,而 另一个是一个小脚本,可以运行它从 路径。
使用XML文件
gnome background可以使用xml文件制作动画背景。 这个小脚本允许您自动生成自己的xml背景。 使用命令行轻松地更改文件。
要生成XML文件,请使用gnome-background-generator
:
usage: gnome-background-generator [-h] [-p PATH] [-o OUTPUT] [-t TRANSITION_TIME] [-d DISPLAY_TIME] [-s] [-b] A simple command line tool to generate an XML file to use for gnome wallpapers, to have dynamic walls optional arguments: -h, --help show this help message and exit -p PATH, --path PATH Path to look for the pictures. If no output is specified, will be used too for outputing the dynamic- wallpaper.xml file. Default value is the current directory (.) -o OUTPUT, --output OUTPUT Output filename. If no filename is specified, a dynamic-wallpaper.xml file will be generated in the path containing the pictures. You can also use "-" to display the xml in the stdout. -t TRANSITION_TIME, --transition-time TRANSITION_TIME Time (in seconds) transitions must last (default value is 2 seconds) -d DISPLAY_TIME, --display-time DISPLAY_TIME Time (in seconds) a picture must be displayed. Default value is 900 (15mn) -s, --set-background '''try to set the background using gnome-appearance- properties -b, --debug
随机更改桌面
还有一个命令可以用来将背景更改为随机的 已知目录中的文件:
$ gnome-wallpaper-select /path/to/walls
如果与cronjob结合使用,第二个选项很有用;不幸的是,它是
有时是一个困难的过程,因为crontab使用dbu,这与
使用gconftool-2
。
下面是一个简单的教程,介绍如何使其工作:
$ wget http://github.com/ametaireau/gnome-background-generator/raw/master/xdbus -O ~/.Xdbus $ crontab -e
然后添加
*/4 * * * * . ~/.Xdbus; /usr/local/bin/gnome-wallpaper-select ~/Images/walls