Mercurial > hg > pub > prymula > scripts
comparison bing4desktop/bing4desktop.py @ 21:7f02682ff5ed
bing4desktop-0.240207-4
author | prymula <prymula76@outlook.com> |
---|---|
date | Wed, 07 Feb 2024 22:51:58 +0100 |
parents | e7a6488c02b7 |
children | 45b565b7b853 |
comparison
equal
deleted
inserted
replaced
20:5c6ead828ca5 | 21:7f02682ff5ed |
---|---|
20 import json | 20 import json |
21 import tempfile | 21 import tempfile |
22 import shutil | 22 import shutil |
23 import glob | 23 import glob |
24 | 24 |
25 ver = "0.240207-3" | 25 ver = "0.240207-4" |
26 | 26 |
27 BING_URI_BASE = "http://www.bing.com" | 27 BING_URI_BASE = "http://www.bing.com" |
28 BING_WALLPAPER_PATH = "/HPImageArchive.aspx?format=js&idx=1&n=1&mkt=en-US" | 28 BING_WALLPAPER_PATH = "/HPImageArchive.aspx?format=js&idx=1&n=1&mkt=en-US" |
29 full_path="" | 29 full_path="" |
30 actualImage = 1 | 30 actualImage = 1 |
102 gsettings = Gio.Settings.new(SCHEMA) | 102 gsettings = Gio.Settings.new(SCHEMA) |
103 gsettings.set_string(KEY, uri) | 103 gsettings.set_string(KEY, uri) |
104 except: | 104 except: |
105 args = ["gsettings", "set", "org.cinnamon.desktop.background", "picture-uri", uri] | 105 args = ["gsettings", "set", "org.cinnamon.desktop.background", "picture-uri", uri] |
106 subprocess.Popen(args) | 106 subprocess.Popen(args) |
107 elif desktop_env=="mate": | 107 elif desktop_env in ['mate', 'lightdm-xsession']: |
108 try: # MATE >= 1.6 | 108 try: # MATE >= 1.6 |
109 # info from http://wiki.mate-desktop.org/docs:gsettings | 109 # info from http://wiki.mate-desktop.org/docs:gsettings |
110 args = ["gsettings", "set", "org.mate.background", "picture-filename", "'%s'" % file_loc] | 110 args = ["gsettings", "set", "org.mate.background", "picture-filename", "'%s'" % file_loc] |
111 subprocess.Popen(args) | 111 subprocess.Popen(args) |
112 except: # MATE < 1.6 | 112 except: # MATE < 1.6 |