change config rules
This commit is contained in:
parent
65236d5671
commit
f4df0e4654
@ -86,14 +86,16 @@ def setTheme(themeName = None, nightMode = False):
|
||||
theme = config[themeName]["night"]
|
||||
else:
|
||||
theme = config[themeName]
|
||||
|
||||
if theme["type"] == "static":
|
||||
if "random" in theme and theme["random"]:
|
||||
setRandomWallpaper(theme["path"])
|
||||
else:
|
||||
setWallpaper(theme["url"])
|
||||
|
||||
elif theme["type"] == "dynamic":
|
||||
dynamic = False
|
||||
random = False
|
||||
|
||||
if "dynamic" in theme and theme["dynamic"]:
|
||||
dynamic = True
|
||||
if "random" in theme and theme["random"]:
|
||||
random = True
|
||||
|
||||
if dynamic:
|
||||
delay = list(map(int,theme["delay"].split(":")))
|
||||
delay.reverse()
|
||||
while len(delay) < 3:
|
||||
@ -101,15 +103,9 @@ def setTheme(themeName = None, nightMode = False):
|
||||
|
||||
delay = delay[0] + delay[1]*60 + delay[2]*3600
|
||||
|
||||
random = False
|
||||
|
||||
if "random" in theme and theme["random"]:
|
||||
random = True
|
||||
|
||||
if 'threadIsAlive' not in globals():
|
||||
globals()['threadIsAlive'] = True
|
||||
|
||||
|
||||
global threadIsAlive
|
||||
while threadIsAlive:
|
||||
if random:
|
||||
@ -117,9 +113,11 @@ def setTheme(themeName = None, nightMode = False):
|
||||
else:
|
||||
setNextWallpaper(theme["path"])
|
||||
sleep(delay)
|
||||
|
||||
else:
|
||||
printHelpInfo()
|
||||
if random:
|
||||
setRandomWallpaper(theme["path"])
|
||||
else:
|
||||
setWallpaper(theme["path"])
|
||||
|
||||
|
||||
def getThemes():
|
||||
|
Loading…
Reference in New Issue
Block a user