Ubuntu 12.04 自动切换桌面背景
来源:互联网 发布:甘肃电大网络考试平台 编辑:程序博客网 时间:2024/05/15 05:12
以前在gnome2时使用gconftool可以改变ubuntu的桌面背景的,装了12.04后,发现不行了,研究了一下,原来改用gsettings这个工具了.
我卸载了unity,装的是gnome-panel桌面.
脚本如下:
#!/bin/bashconfFile=".switchbg.conf"cd $(dirname $0)filepath=$PWDfind $filepath | grep -E ".jpg$|.png$|.JPG$|.PNG$" > $confFilecnt=`cat $confFile | wc -l`while truedoline=$(($RANDOM % $cnt + 1))bgfile=$(head -n $line $confFile | tail -n 1)bgfile="'file://$bgfile'"bkfile=$(gsettings get org.gnome.desktop.background picture-uri)echo $bkfileecho $bgfileif [ $bkfile != $bgfile ]thenbreakfidonegsettings set org.gnome.desktop.background picture-uri $bgfilerm -f $confFile
保存后加到crontab里发现脚本的gsettings set不起作用.所以只能改一下了:
#!/bin/bashconfFile=".switchbg.conf"changedtime=600cd $(dirname $0)filepath=$PWDfind $filepath | grep -E ".jpg$|.png$|.JPG$|.PNG$" > $confFilecnt=`cat $confFile | wc -l`while truedowhile truedoline=$(($RANDOM % $cnt + 1))bgfile=$(head -n $line $confFile | tail -n 1)bgfile="'file://$bgfile'"bkfile=$(gsettings get org.gnome.desktop.background picture-uri)if [ $bkfile != $bgfile ]thenbreakfidonegsettings set org.gnome.desktop.background picture-uri $bgfile >> tmp.logsleep $changedtimedonerm -f $confFile让脚本在启动时自动加载就好了.间隔时间修改changedtime的值就行了,单位为秒.
- Ubuntu 12.04 自动切换桌面背景
- win7怎么切换桌面背景
- ubuntu壁纸自动切换
- linux自动每日更新桌面背景
- ubuntu 9.10 桌面壁纸自动切换
- ubuntu桌面背景的默认路径
- 自动更改桌面背景 c/c++ win32
- ubuntu桌面图片自动切换工具DIY
- Ubuntu 10.04中自定义桌面背景幻灯片
- wince6.0桌面背景+设置默认IP+开机自动运行程序
- 自定义制作 自动定时更换图片的桌面背景 html页面
- 自己动手写Python实现Ubuntu自动切换壁纸
- ubuntu sudo自动切换root 无需输入密码
- ubuntu sudo自动切换root 无需输入密码
- Ubuntu 设定壁纸自动切换的shell脚本
- Ubuntu登录后一直停留在桌面,只显示桌面背景
- ubuntu 12.04 独立显卡切换
- Tab切换和自动切换
- Android上解析Json格式数据
- AddressBook 地址簿 (电话簿) 访问与修改
- 序列化协议(protobuf,xstream,jackjson,jdk,hessian)对比
- vss 与 svn 区别
- poj 1256 next_permutation
- Ubuntu 12.04 自动切换桌面背景
- Java 中文乱码
- 背包问题-Bone Collector
- Android的应用前景
- 2种程序创建程序的方法
- UIPageControl
- hdu1546 dijkstra
- POJ 1703 Find them, Catch them【典型并查集:判断在不同的集合】
- FIELD-SYMBOLS的两种用法