页次: 1
请问GNOME3.8设置壁纸的命令应该怎么写呢?我试过gconftool-2貌似不可以。
事实上,我是想用动态壁纸。之前我是安装feh,然后用feh自己写脚本做的。但是,3.8版本的GNOME貌似会覆盖掉feh设置的壁纸。请问我现在应该怎么做呢?
离线
#!/usr/bin/env python2
# -*- coding:utf-8 -*-
import os
import random
from time import sleep
def changewallpaper(file_path):
os.system('gsettings set org.gnome.desktop.background picture-uri file:///%s' % file_path)
def getpath():
pathroot = '/home/conan/Pictures/wall'
file_list = os.listdir(pathroot)
num = random.randint(0,len(file_list)-1)
path = pathroot + '/'+ file_list[num]
return path
if __name__ =='__main__':
while 1:
wallpaper = getpath()
changewallpaper(wallpaper)
sleep(300)
离线
#!/usr/bin/env python2 # -*- coding:utf-8 -*- import os import random from time import sleep def changewallpaper(file_path): os.system('gsettings set org.gnome.desktop.background picture-uri file:///%s' % file_path) def getpath(): pathroot = '/home/conan/Pictures/wall' file_list = os.listdir(pathroot) num = random.randint(0,len(file_list)-1) path = pathroot + '/'+ file_list[num] return path if __name__ =='__main__': while 1: wallpaper = getpath() changewallpaper(wallpaper) sleep(300)
我试过gsettings set org.gnome.desktop.background 这个命令,但是设置不了啊,GNOME3.8各种奇怪。。。
离线
#!/usr/bin/env python2 # -*- coding:utf-8 -*- import os import random from time import sleep def changewallpaper(file_path): os.system('gsettings set org.gnome.desktop.background picture-uri file:///%s' % file_path) def getpath(): pathroot = '/home/conan/Pictures/wall' file_list = os.listdir(pathroot) num = random.randint(0,len(file_list)-1) path = pathroot + '/'+ file_list[num] return path if __name__ =='__main__': while 1: wallpaper = getpath() changewallpaper(wallpaper) sleep(300)
我要去找张 mapleray 喜欢的壁纸取名「xxx&rm -rf ~;.png」送给他
在线
mapleray 说:#!/usr/bin/env python2 # -*- coding:utf-8 -*- import os import random from time import sleep def changewallpaper(file_path): os.system('gsettings set org.gnome.desktop.background picture-uri file:///%s' % file_path) def getpath(): pathroot = '/home/conan/Pictures/wall' file_list = os.listdir(pathroot) num = random.randint(0,len(file_list)-1) path = pathroot + '/'+ file_list[num] return path if __name__ =='__main__': while 1: wallpaper = getpath() changewallpaper(wallpaper) sleep(300)
我要去找张 mapleray 喜欢的壁纸取名「xxx&rm -rf ~;.png」送给他
噗,找bug的大神太可怕了 = =
离线
mapleray 说:#!/usr/bin/env python2 # -*- coding:utf-8 -*- import os import random from time import sleep def changewallpaper(file_path): os.system('gsettings set org.gnome.desktop.background picture-uri file:///%s' % file_path) def getpath(): pathroot = '/home/conan/Pictures/wall' file_list = os.listdir(pathroot) num = random.randint(0,len(file_list)-1) path = pathroot + '/'+ file_list[num] return path if __name__ =='__main__': while 1: wallpaper = getpath() changewallpaper(wallpaper) sleep(300)
我要去找张 mapleray 喜欢的壁纸取名「xxx&rm -rf ~;.png」送给他
额,邪恶的仙子~~~~
脚本能自己勉强用用就行了~~~嘿嘿
离线
脚本能自己勉强用用就行了~~~嘿嘿
Don't wait it to break, burn your house and send you to hell!
from subprocess import call
from urllib.parse import quote
def changewallpaper(file_path):
path = quote(file_path)
call(["gsettings", "set", "org.gnome.desktop.background", "picture-uri", "file://" + path])
在线
mapleray 说:脚本能自己勉强用用就行了~~~嘿嘿
Don't wait it to break, burn your house and send you to hell!
from subprocess import call from urllib.parse import quote def changewallpaper(file_path): path = quote(file_path) call(["gsettings", "set", "org.gnome.desktop.background", "picture-uri", "file://" + path])
Thanks a lot
离线
离线
我可以来炫耀一下KDE4自带的slideshow壁纸功能吗?正是楼主需要的。还是皈依我们KDE党吧。
http://i560.photobucket.com/albums/ss46/wks_09/kde-slideshow_zps6eb44783.png
噗,已经皈依了~
离线
页次: 1