-
Notifications
You must be signed in to change notification settings - Fork 0
/
wallpaper.py
executable file
·47 lines (38 loc) · 1.92 KB
/
wallpaper.py
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/usr/bin/python
import os
# import random
# import time
import datetime
path = os.path.join(os.getcwd(), "/home/nick/wallpaper/wallpapers")
print(path)
# os.system('xrandr --output HDMI1 --auto --left-of eDP1')
os.system('xrandr --output HDMI1 --mode 1920x1080 --auto --left-of eDP1')
Lpath = os.path.join(path, "1920x1080")
img1 = os.path.join(Lpath, "cropped-1920-1080-84284.jpg")
Rpath = os.path.join(path, "1366x768")
img2 = os.path.join(Rpath, "cropped-1366-768-793604.jpg")
os.system("echo '' > /home/nick/wallpaper/error.log")
os.system("echo '============================' >> /home/nick/wallpaper/error.log")
os.system("echo '" + str(datetime.datetime.now()) + "' >> /home/nick/wallpaper/error.log")
os.system("echo '============================' >> /home/nick/wallpaper/error.log")
os.system("convert " + img1 + " " + img2 + " +append wallpaper.png 2>> /home/nick/wallpaper/error.log")
os.system("nitrogen --set-centered /home/nick/wallpaper.png --save 2>> /home/nick/wallpaper/error.log")
# while True:
# Lpath = os.path.join(path, "1920x1080")
# Limages = [f for f in os.listdir(Lpath) if os.path.isfile(os.path.join(Lpath, f))]
# Limages = [os.path.join(Lpath, f) for f in Limages]
# img1 = random.choice(Limages)
#
# Rpath = os.path.join(path, "1366x768")
# Rimages = [f for f in os.listdir(Rpath) if os.path.isfile(os.path.join(Rpath, f))]
# Rimages = [os.path.join(Rpath, f) for f in Rimages]
# img2 = random.choice(Rimages)
#
# os.system("echo '' > error.log")
# os.system("echo '============================' >> error.log")
# os.system("echo '" + str(datetime.datetime.now()) + "' >> error.log")
# os.system("echo '============================' >> error.log")
# os.system("convert " + img1 + " " + img2 + " +append wallpaper.png 2>> error.log")
# os.system("nitrogen --set-centered /home/nick/wallpaper.png --save 2>> error.log")
# #time.sleep(1200)
# time.sleep(15)