一个简单的命令行工具,用于生成动态Gnome壁纸的XML文件
项目描述
此包提供了两种方法来自动更改您的桌面。一种是通过生成一个可以被Gnome系统使用的XML文件,另一种是您可以运行的小脚本,用于从路径中随机选择图片。
使用XML文件
Gnome壁纸可以使用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结合使用时很有用;不幸的是,有时这是一个繁琐的过程,因为crontabs使用dbus,这与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