我正在编写一个脚本,它将更改我的桌面墙纸。这是我当前的脚本:
import os
from time import localtime
from pathlib import Path
wp = Path("/home/lucasmccallums/Desktop/projects/wallpaper_transitions")
hour = localtime().tm_hour
if (hour < 6) or (hour >= 21):
os.system("pcmanfm --set-wallpaper=" + str(wp / "night.png"))
elif (hour >= 14):
os.system("pcmanfm --set-wallpaper=" + str(wp / "afternoon.png"))
else:
os.system("pcmanfm --set-wallpaper=" + str(wp / "morning.png"))
现在,我需要在06:00、14:00和21:00重复该脚本,以使其在白天以及启动时自动更改。
任何帮助将不胜感激,谢谢!
在Crontab上
0 6,14,21 * * */usr/bin/somedirectory/py.....