Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
duch3201 committed Feb 3, 2023
2 parents 1df0df1 + 2bb9eaf commit 4630dfb
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Themes/MCwalp.udd/Wallpaper.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
],
"Night":[
{
"id":3,
"id":3,
"file":"3.png",
"tag":"sunset",
"title":"Minecraft canyon - At sun set",
Expand Down
16 changes: 15 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import time
import utils
import menu
import menu
import pytz
from astral.location import LocationInfo
from astral.sun import sun
Expand Down Expand Up @@ -77,22 +78,30 @@ def Darwin():
img = jsonTheme["Day"][0]["file"]
if Wallpaper_info == True:
img = utils.add_text(Info_position, img)
if Wallpaper_info == True:
img = utils.add_text(Info_position, img)
elif sunrise.time() <= current_time < sunset.time():
print("day")
img = jsonTheme["Day"][1]["file"]
if Wallpaper_info == True:
img = utils.add_text(Info_position, img)
if Wallpaper_info == True:
img = utils.add_text(Info_position, img)
elif sunset.time() <= current_time < dusk.time():
img = jsonTheme["Night"][0]["file"]
print("sunset")
if Wallpaper_info == True:
img = utils.add_text(Info_position, img)
if Wallpaper_info == True:
img = utils.add_text(Info_position, img)
else:
img = jsonTheme["Night"][1]["file"]
print("night")
if Wallpaper_info == True:
img = utils.add_text(Info_position, img)

if Wallpaper_info == True:
img = utils.add_text(Info_position, img)

path_to_image = path + "/images/" + str(img)
path = NSURL.fileURLWithPath_(path_to_image)
Expand All @@ -101,7 +110,7 @@ def Darwin():
workspace.setDesktopImageURL_forScreen_options_error_(path, screen[0], {}, None)

#print("\n\n dawn", dawn, "\n\n noon", noon, "\n\n sunset", sunset, "\n\n dusk", dusk, "\n\n current time", current_time, "\n\n img", img, "\n\n path", path_to_image )

print("\n\n Wallpaper_info", Wallpaper_info, "\n\n Wallpaper_interval",Wallpaper_interval, "\n\n Info_position", Info_position, "\n\n City",City, "\n\n Country",Country)


def Windowswalp():
Expand Down Expand Up @@ -139,6 +148,8 @@ def main():
os_name = platform.system()

Refresh_interval = utils.get_settings("Wallpaper_interval")
Refresh_interval = utils.get_settings("Wallpaper_interval")


if os_name == "Windows":
utils.discovery()
Expand All @@ -147,9 +158,12 @@ def main():
print("sorry, Linux is not supported yet!")
elif os_name == "Darwin":
utils.discovery()
menu.menu()
while True:
Darwin()
print(Refresh_interval)
time.sleep(Refresh_interval)
print(Refresh_interval)
time.sleep(Refresh_interval)

main()

0 comments on commit 4630dfb

Please sign in to comment.