首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何自定义桌面壁纸幻灯片?

如何自定义桌面壁纸幻灯片?
EN

Ask Ubuntu用户
提问于 2011-10-23 13:27:01
回答 8查看 15.3K关注 0票数 5

我花了一些时间尝试了很多事情,但都没有用。下面是我到目前为止尝试过的(手动更改幻灯片):

  1. /usr/share/backgrounds/mywallpapers中创建一个新文件夹并在那里添加我的background-1.xml
  2. 将一堆壁纸复制到/usr/share/backgrounds/
  3. /usr/share/backgrounds/Contest/background-1.xml复制到/usr/share/backgrounds/

我登出和进入,仍然没有改变外观应用程序。

我听说过Wallch,但我不希望某个应用程序一直在后台运行。我甚至不确定Wallch是否会与Gnome 3合作。我也尝试了gnome-3-wp(Gnome 3壁纸幻灯片应用程序),但对于Ubuntu11.10的Oneiric来说,它似乎坏了。

有人有解决办法吗?

EN

回答 8

Ask Ubuntu用户

发布于 2011-10-29 03:47:55

我想我迟到了但是..。

我创建了一个xml背景(带有完整的路径描述),并将其保存在/usr/share/backgrounds/my-back背景.xml中。

然后我编辑了/usr/share/gnome-background-properties/ubuntu-wallpapers.xml

代码语言:javascript
复制
<wallpaper deleted="false">
 <name>My background</name>
 <filename>/usr/share/backgrounds/my-background.xml</filename>
 <options>zoom</options>
</wallpaper> 

只需保存文件,新幻灯片壁纸将显示在“外观”窗口中。

希望它对你有用。

票数 6
EN

Ask Ubuntu用户

发布于 2011-11-01 20:11:25

此外,在编辑/usr/share/gnome-background-properties/ubuntu-wallpapers.xml,时,将所有选项标记组合在一起将允许您在设置中的外观GUI中选择平铺、缩放、中心、缩放、填充或跨越。

使用上面Locutus的示例:

代码语言:javascript
复制
<wallpaper deleted="false">
 <name>My background</name>
 <filename>/usr/share/backgrounds/my-background.xml</filename>
</wallpaper>
票数 5
EN

Ask Ubuntu用户

发布于 2012-11-17 02:14:19

我使用我编写的以下脚本,并使用gnome‘’启动程序启动它。为了提高系统性能,脚本在运行XMBC或VLC或系统负载超过指定阈值时挂起幻灯片。

将脚本保存到文件和chmod +x中,使其自动执行。

wallpaper-slideshow.sh

代码语言:javascript
复制
#!/usr/bin/python

import os
import random
import time
import re
import subprocess

# directory where Pictures are stored
pictureDirectory = os.getenv("HOME") + "/.xbmc/userdata/Thumbnails/Video/Fanart"

# time in seconds to wait between transitions 
duration=60

# maximum system load before the slideshow is suspended
maxSysLoad=0.5

def getPictureList():
    result = []
    for root, sub, files in os.walk(pictureDirectory): 
        for f in files:
            if f.endswith(('.jpeg','.jpg','png','.tbn')):
                result.append(os.path.join(root, f))               
    return result


def getSystemLoad():
    uptimeString = subprocess.check_output(["uptime"])
    return float(re.match(r".*load average: ([^,]+),.*", uptimeString).group(1))

def isProcRunning(name):
    with open(os.devnull, "w") as devnull:
        return subprocess.call(["pidof", name], stdout=devnull) == 0

def setDesktopBackgroundPicture(filename):
    return subprocess.call(["gsettings", "set", 
        "org.gnome.desktop.background", 
        "picture-uri", '"file://' + filename + '"'])

def main():
    time.sleep(10) # startup delay    
    pictureList = getPictureList() 
    while 1:       
        if getSystemLoad() > maxSysLoad or isProcRunning("vlc") or isProcRunning("xbmc.bin") :
            print "slide show suspended while VLC or XMBC is running or system load is high"
        else:
            picture = random.choice(pictureList)
            print picture
            setDesktopBackgroundPicture(picture)
        
        time.sleep(duration)
        
if __name__ == "__main__":
    main()        
票数 2
EN
页面原文内容由Ask Ubuntu提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://askubuntu.com/questions/71008

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档