600字范文,内容丰富有趣,生活中的好帮手!
600字范文 > linux桌面动态 ubuntu 中设置动态壁纸

linux桌面动态 ubuntu 中设置动态壁纸

时间:2018-09-29 14:43:54

相关推荐

linux桌面动态 ubuntu 中设置动态壁纸

为了开发android 功能,ubuntu系统也使用了好久时间,作为一个经常使用的系统,不捣鼓捣鼓就太平淡,根据网上的一些介绍,搞了一个动态壁纸出来,用来定时更换壁纸。

首先创建一个文件夹,里面三个文件,其余根据自己喜好放入壁纸文件。

第一个文件addbackground.sh,需要可执行权限

sudo rm -rf /usr/share/backgrounds/test

sudo mkdir /usr/share/backgrounds/test

sudo cp *.jpg /usr/share/backgrounds/test/

. makelist.sh > background.xml

sudo cp background.xml /usr/share/backgrounds/test/

sudo cp cust-wallpapers.xml /usr/share/gnome-background-properties/

gsettings set org.gnome.desktop.background picture-uri 'file:///usr/share/backgrounds/test/background.xml'

第二个文件,用于拷贝到gnome-background-properties,这样设置里面就可以选择作为动态壁纸

wentao wallpaper

/usr/share/backgrounds/test/background.xml

zoom

第三个文件makelist.sh 也需要可执行权限

#!/bin/bash

# wentao add .6.27

#get current path

basepath=$(cd `dirname $0`; pwd)

#get all jpg wallpapers

files=`ls $basepath |grep jpg`

lastfile='empty'

echo ''

echo ' '

echo ' '

echo ' 3'

echo ' 15'

echo ' 00'

echo ' 00'

echo ' 00'

echo ' '

for current_file in $files

do

if [[ $lastfile == 'empty' ]]

then

lastfile=$current_file

echo ' '

echo ' 300.0'

echo " /usr/share/backgrounds/test/$lastfile"

echo ' '

else

echo ' '

echo ' 5.0'

echo " /usr/share/backgrounds/test/$lastfile"

echo " /usr/share/backgrounds/test/$current_file"

echo ' '

echo ' '

echo ' 300.0'

echo " /usr/share/backgrounds/test/$current_file"

echo ' '

lastfile=$current_file

fi

done

echo ''

设置完成以后,运行 ./addbackgroundd.sh,就可以设置动态壁纸了,如果想更换动态壁纸里的图片,只要更新当前文件夹里面的图片就可以了。

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。