[转] 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
实现原理是使用一个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
相关文章推荐
- ubuntu / Mint下 perl 实现动态桌面壁纸 生成xml的实用脚本
- ubuntu下实现动态桌面壁纸
- Ubuntu VS Linux Mint,谁是Linux家族桌面系统之王?
- linux下动态链接实现原理
- Linux下动态链接实现原理
- Python脚本实现调节Ubuntu/LinuxMint屏幕亮度+色温
- 在ubuntu中cosmos动态壁纸的python实现脚本
- Linux下动态链接实现原理
- linux 下动态链接实现原理
- 动态替换Linux核心函数的原理和实现
- Mint Linux桌面壁纸:清凉的薄荷 1920 x 1080
- linux 下动态链接实现原理
- Ubuntu 14.10 / Linux Mint 17.1 编译安装 rdesktop 1.8.3 连接Win10的远程桌面
- Linux下动态链接实现原理
- 动态替换Linux核心函数的原理和实现
- linux下动态链接实现原理
- 设置一个动态的壁纸作为你的linux桌面
- TCP/IP原理、基础以及在Linux上的实现 (3)
- java 如何实现动态代理(mybatis底层原理)
- LKU:一套在 Ubuntu/LinuxMint 上编译、安装和更新最新内核的 Shell 脚本