add auto cheng in interval via apscheduler

This commit is contained in:
Arthur 2022-06-22 17:39:22 +05:00
parent e68aecde6c
commit 0823c0638e
3 changed files with 12 additions and 6 deletions

View file

@ -1,12 +1,11 @@
import os
import random
PATH = '/home/arthur/img/Wallpapers/media/'# path to media
from apscheduler.schedulers.background import BlockingScheduler
PATH = '/home/arthur/img/Wallpapers/test/'# path to media
files = os.listdir(PATH)
media = random.choices(files)[0]
def run(command,output=False):
devNull = ">/dev/null"
if output == True:
@ -20,6 +19,8 @@ def kill():
run(f'kill {pid}')
def setWallPeper():
media = random.choices(files)[0]
if media[-4:] != '.gif':
run(f"feh --bg-scale {PATH}{media}")
else: