Last active
March 17, 2023 15:35
-
-
Save lucivaldo/0fc5167e245d5eea2d975c01aa3cec7f to your computer and use it in GitHub Desktop.
Script Python para alterar o wallpaper
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
#!/usr/bin/env python3 | |
import glob | |
import os | |
import random | |
import time | |
PICTURES_PATH = os.path.join(os.path.expanduser("~"), "Pictures") | |
WALLPAPERS_PATH = os.path.join(PICTURES_PATH, "Wallpapers") | |
while True: | |
wallpapers = glob.glob(WALLPAPERS_PATH + "/**/*", recursive=True) | |
wallpaper = random.choice(wallpapers) | |
if os.path.isfile(wallpaper): | |
command = "gsettings set org.gnome.desktop.background picture-uri \"{}\"".format(wallpaper) | |
os.system(command) | |
time.sleep(300) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment