ubuntu / Mint下 实现动态桌面壁纸切换 XML配置文件生成实用perl脚本

实现原理是使用一个xml文件来记录可供切换选择的壁纸。下面展示的是10.04中自带的一个样例。
首先说明一下,ubuntu默认的壁纸存放在/usr/share/backgrounds/目录下的,在该目录中还有一个cosmos(意思是“宇宙”)目录,cosmos里面的xml文件就是实现动态桌面壁纸切换功能的了。
本脚本就是对给定图片文件夹快速生成相应 xml配置文件。
现在关键是生成相应的xml 配置文件了,里面的类容比较繁杂,手动更新太麻烦了,所以想到以脚本实现。

1. perl 写成的源代码如下:

#!/usr/bin/perl
#==============================================================================#
#-------------------------------help-info-start--------------------------------#
=head1 Name

getBackgroundXML.pl --> generate the background.xml file to change Ubuntu background picture dynamiclly

=head1 Usage

perl getBackgroundXML.pl [<options>] [-d PicDir='.'] [-t TimeToLast=1795.0] [-i Interval=5.0] [-o Background.xml=STDOUT]

-help print this help to screen
-a flag ,if set ,write all pictures to one xml file
-d directory contains the jpgs, defalt : '.'
-t time to change background picture, unit : seconds, default : 1795.0
-i interval time spend to change the two pictures, default : 5.0
-o write result to a file , default : STDOUT

=head1 Example

perl getBackgroundXML.pl -d Windows7 -t 25 -i 5 -o Windows7.xml
perl getBackgroundXML.pl --

=head1 Version

Verion : 2.0
Created : 08/18/2010 03:34:52 PM
Updated : 08/18
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值