Mercurial > hg > pub > prymula > scripts
comparison bing4desktop/bing4desktop.py @ 32:40f51ad1e9ba
bing4desktop-0.240208-2
author | prymula <prymula76@outlook.com> |
---|---|
date | Thu, 08 Feb 2024 18:29:07 +0100 |
parents | c1061f0721d7 |
children | 1d063d3bf7ff |
comparison
equal
deleted
inserted
replaced
31:c1061f0721d7 | 32:40f51ad1e9ba |
---|---|
152 subprocess.Popen(args) | 152 subprocess.Popen(args) |
153 elif desktop_env=="blackbox": | 153 elif desktop_env=="blackbox": |
154 # command found at http://blackboxwm.sourceforge.net/BlackboxDocumentation/BlackboxBackground | 154 # command found at http://blackboxwm.sourceforge.net/BlackboxDocumentation/BlackboxBackground |
155 args = ["bsetbg", "-full", file_loc] | 155 args = ["bsetbg", "-full", file_loc] |
156 subprocess.Popen(args) | 156 subprocess.Popen(args) |
157 elif desktop_env=="lxde": | 157 elif desktop_env in ['xqt', 'Lubuntu']: |
158 args = "pcmanfm --set-wallpaper %s --wallpaper-mode=scaled" % file_loc | 158 #args = "pcmanfm --set-wallpaper %s --wallpaper-mode=scaled" % file_loc |
159 args = "pcmanfm-qt --set-wallpaper=" + file_loc + " --wallpaper-mode=fit" | |
160 print ("ALOCHA: "+args) | |
159 subprocess.Popen(args,shell=True) | 161 subprocess.Popen(args,shell=True) |
160 elif desktop_env=="WindowMaker": | 162 elif desktop_env=="WindowMaker": |
161 # From http://www.commandlinefu.com/commands/view/3857/set-wallpaper-on-windowmaker-in-one-line | 163 # From http://www.commandlinefu.com/commands/view/3857/set-wallpaper-on-windowmaker-in-one-line |
162 args = "wmsetbg -s -u %s" % file_loc | 164 args = "wmsetbg -s -u %s" % file_loc |
163 subprocess.Popen(args,shell=True) | 165 subprocess.Popen(args,shell=True) |
236 if wp.get() == False: | 238 if wp.get() == False: |
237 cleanup() | 239 cleanup() |
238 exit | 240 exit |
239 | 241 |
240 # Wszystko pięknie tylko metoda 'show', zmienia nazwę pliku przechowywanego w TMP | 242 # Wszystko pięknie tylko metoda 'show', zmienia nazwę pliku przechowywanego w TMP |
241 # Pozatym nie ubija a nie znalazłem nic lepszego | 243 ## Pozatym nie ubija a nie znalazłem nic lepszego |
242 print ("GLOB: ", glob.glob( os.path.join('/tmp', '*.PNG'))) | 244 #print ("GLOB: ", glob.glob( os.path.join('/tmp', '*.PNG'))) |
243 for infile in glob.glob( os.path.join('/tmp', '*.PNG')): | 245 #for infile in glob.glob( os.path.join('/tmp', '*.PNG')): |
244 print ("INFILE: ", infile) | 246 # print ("INFILE: ", infile) |
245 viewer = subprocess.Popen(['/usr/bin/eom', infile]) | 247 # viewer = subprocess.Popen(['/usr/bin/eom', infile]) |
246 viewer.terminate() | 248 # viewer.terminate() |
247 viewer.kill() # make sure the viewer is gone; not needed on Windows | 249 # viewer.kill() # make sure the viewer is gone; not needed on Windows |
248 | 250 |
249 img = Image.open(full_path) #.convert('RGBA') # PIL solution | 251 img = Image.open(full_path) #.convert('RGBA') # PIL solution |
250 self.tmp = img.resize((600, 400), None, None, 3.0) | 252 self.tmp = img.resize((600, 400), None, None, 3.0) |
251 self.tmp.show() | 253 self.tmp.show() |
252 icon.notify(TITLE + ' --- ' + COPYRIGHT_TXT) | 254 icon.notify(TITLE + ' --- ' + COPYRIGHT_TXT) |