Skip to content

Instantly share code, notes, and snippets.

@pashazz
Last active January 9, 2017 08:55
Show Gist options
  • Save pashazz/84846bad449910c684245e5c141d8a3c to your computer and use it in GitHub Desktop.
Save pashazz/84846bad449910c684245e5c141d8a3c to your computer and use it in GitHub Desktop.
patch -p1 /usr/lib/python3.6/site-packages/wpreddit/wallpaper.py wallpaper.py.patch
--- wallpaper.py.old 2017-01-09 11:05:16.554035609 +0300
+++ wallpaper.py 2017-01-09 11:34:56.456909197 +0300
@@ -51,6 +51,15 @@
os.system("xfconf-query -c xfce4-desktop -p " + prop + " -s 'true'")
elif de in ["lubuntu", "Lubuntu"]:
os.system("pcmanfm -w %s" % path)
+ elif de in ["/usr/share/xsessions/plasma"]:
+ files = os.listdir(config.walldir)
+ for file in files:
+ if re.search('wallpaper[0-9]+\.jpg', file) is not None:
+ os.remove(config.walldir + "/" + file)
+ randint = random.randint(0, 65535)
+ randpath = os.path.expanduser(config.walldir + "/wallpaper%s.jpg" % randint)
+ shutil.copyfile(path, randpath)
+ os.system("ksetwallpaper %s" % randpath)
else:
if config.setcmd == '':
print("Your DE could not be detected to set the wallpaper."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment