Last active
July 30, 2017 09:08
-
-
Save krishnachaitanya7/64ab1a2633239456dbe7 to your computer and use it in GitHub Desktop.
#directions to use- place this python file in a folder containing wallpapers and run the python code. That's it. and importantly #run the code as non-sudo user!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#directions to use- place this python file in a folder containing wallpapers and run the python code. Thats it. and importantly #run the code as non-sudo user! | |
#/usr/bin/env python | |
import os | |
from subprocess import call | |
import glob | |
import time | |
wall_change_time = 10 | |
def set_wallpaper(image_file_with_path): | |
filepath = os.path.abspath(image_file_with_path) | |
call(['gsettings', 'set', 'org.gnome.desktop.background', 'picture-uri', 'file://%s' % (filepath)]) | |
return True | |
#while os.geteuid() == 0: | |
while(1): | |
for file_jpg in glob.glob("*.jpg"): | |
print("your desktop background will be changing.") | |
set_wallpaper(file_jpg) | |
time.sleep(wall_change_time) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment