-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwallpaperchanger.py
More file actions
executable file
·28 lines (27 loc) · 888 Bytes
/
Copy pathwallpaperchanger.py
File metadata and controls
executable file
·28 lines (27 loc) · 888 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/python
import os, time, sys, random, shutil
from subprocess import call
#See if there is the right amount of arguments
if len(sys.argv)==5:
#Sets the wallpaper directory
DIR = sys.argv[1]
#Sets the pictuers desternation
DST = sys.argv[2]
#Sets the time to pause
TIME = float(sys.argv[3])
#Sets directory to the image directory
os.chdir(DIR)
#Waits till the time is set
while True:
time.sleep(TIME)
#Selects a random image file
FILE = random.choice(os.listdir(DIR))
#Deletes the image in the pictuers distanation
#os.remove(DST)
#Copies the file
shutil.copy2(FILE, DST)
#Reseats i3wm
call(["wal", "-c", "-i", DST, "-a " + sys.argv[4]])
call(["feh", "--bg-scale", DST])
else:
print("Please make sure that you have 3 arguments at the end of the command")