为动态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

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
javascript点击文本(文本链接到web url)如何打开   java将一个按钮替换为另一个按钮   J2ME上的java音频,我不知道哪里出了问题?   java异常仅在调试+断点中引发   图形按钮文本在4Gb Ram和IBM Java 1.5中消失   java如何在输入错误的用户名和/或密码时将用户从登录控件重定向到错误页面?   java对象的计算时代有什么好处?   加密限制了应用程序功能的启动   swing只有在我移动鼠标时才会显示组件。帮助(爪哇)   使用Spring进行java密码加密/解密   Java8Java。时间:如何更改一周中的某一天和一天的开始时间?   java Android:设置文本视图中来自另一个活动的文本不起作用   如何在java中创建ActionEvent类的对象?   java Tomcat 7和无效的密钥库格式   GWT面板类型的java问题   字符输入java中的异常   带有文件输出的java JOptionPane   java Kotlin泛型声明站点方差<在T>构造中   java是非对话框,带进度