您的位置:首页 > 运维架构 > Linux

[转] ubuntu Linux/Mint 下实现动态桌面壁纸 de 原理

2010-10-08 00:00 651 查看
不知大家在使用ubuntu时有没有注意到,ubuntu下是可以实现多张壁纸动态切换的,好像Win7下也有类似的功能(曾经使用win7一段时间)。我也是最近才注意到这点,下面是在ubuntu10.04下实验的,之前版本的应该也可以。
实现原理是使用一个xml文件来记录可供切换选择的壁纸。下面展示的是10.04中自带的一个样例。
首先说明一下,ubuntu默认的壁纸存放在/usr/share/backgrounds/目录下的,在该目录中还有一个cosmos(意思是“宇宙”)目录,cosmos里面的xml文件就是实现动态桌面壁纸切换功能的了。

jarson@jarson-laptop:/usr/share/backgrounds/cosmos$ ls
background-1.xml cloud.jpg earth-horizon.jpg helix-nebula.jpg sombrero.jpg
blue-marble-west.jpg comet.jpg galaxy-ngc3370.jpg jupiter.jpg whirlpool.jpg
jarson@jarson-laptop:/usr/share/backgrounds/cosmos$ cat background-1.xml

starttime标签设置动画(幻灯片)开始的时间,可根据自己制作的时间设定,这个应该不影响实际要实现的功能
2009
08
04
00
00
00

"animation"动画的意思
"static"静态的意思
1800.0 duration标签设置持续的时间,以秒为单位。
/usr/share/backgrounds/cosmos/cloud.jpg file标签指定壁纸存放的路径

"transition"切换的意思
5.0
/usr/share/backgrounds/cosmos/cloud.jpg from ... to从壁纸A切换到壁纸B。
/usr/share/backgrounds/cosmos/comet.jpg

1800.0
/us
3ff0
r/share/backgrounds/cosmos/comet.jpg

5.0
/usr/share/backgrounds/cosmos/comet.jpg
/usr/share/backgrounds/cosmos/earth-horizon.jpg

1800.0
/usr/share/backgrounds/cosmos/earth-horizon.jpg

5.0
/usr/share/backgrounds/cosmos/earth-horizon.jpg
/usr/share/backgrounds/cosmos/blue-marble-west.jpg

1800.0
/usr/share/backgrounds/cosmos/blue-marble-west.jpg

5.0
/usr/share/backgrounds/cosmos/blue-marble-west.jpg
/usr/share/backgrounds/cosmos/galaxy-ngc3370.jpg

1800.0
/usr/share/backgrounds/cosmos/galaxy-ngc3370.jpg

5.0
/usr/share/backgrounds/cosmos/galaxy-ngc3370.jpg
/usr/share/backgrounds/cosmos/helix-nebula.jpg

1800.0
/usr/share/backgrounds/cosmos/helix-nebula.jpg

5.0
/usr/share/backgrounds/cosmos/helix-nebula.jpg
/usr/share/backgrounds/cosmos/jupiter.jpg

1800.0
/usr/share/backgrounds/cosmos/jupiter.jpg

5.0
/usr/share/backgrounds/cosmos/jupiter.jpg
/usr/share/backgrounds/cosmos/sombrero.jpg

1800.0
/usr/share/backgrounds/cosmos/sombrero.jpg

5.0
/usr/share/backgrounds/cosmos/sombrero.jpg
/usr/share/backgrounds/cosmos/whirlpool.jpg

1800.0
/usr/share/backgrounds/cosmos/whirlpool.jpg

5.0
/usr/share/backgrounds/cosmos/whirlpool.jpg
/usr/share/backgrounds/cosmos/cloud.jpg

注意from ... to要构成一个循环。
设置动态桌面壁纸有两个好的功能:1、满足自己设置多张壁纸的需要;2、时间提醒,例如我这里设置半小时切换一次,这样每次桌面变换时,我就会知道半个小时又过去了。。。

设置好后的应用方法:右键桌面->更改桌面背景->添加,在弹出对话框的右下方那里选择“全部文件”(默认是“图像”),然后找到你定义好的动态桌面壁纸的xml文件,双击添加就可以了。

refrence
http://blog.chinaunix.net/u3/109488/showart_2241867.html
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: