Skip to content
This repository has been archived by the owner on May 27, 2023. It is now read-only.

launchd doesn't run darkmode script if solar time was missed while computer was off #4

Closed
bandgeekdante opened this issue Aug 24, 2018 · 4 comments
Labels
bug Something isn't working

Comments

@bandgeekdante
Copy link

If the computer was sleeping, the StartCalendarInterval fires as soon as the computer wakes if the interval was missed, but this is not the case if the computer was off at the time. On my machine I'm fixing it by making RunAtLoad true on the plist, but you may want to consider this as well for the official release?

@bandgeekdante
Copy link
Author

bandgeekdante commented Aug 24, 2018

My issue is that I generally turn off my Mac at night (so it'll be in dark mode) and when I turn it on in the morning it's already past sunrise and it just stays in dark mode. I'm using version 1.6 of darkmode and running macOS High Sierra. Other than that though I really appreciate the app!!

@katernet katernet added the bug Something isn't working label Aug 28, 2018
@katernet
Copy link
Owner

Thanks for the report @bandgeekdante

It seems scheduled launchd jobs indeed don't resume after shutdown - https://developer.apple.com/library/archive/documentation/MacOSX/Conceptual/BPSystemStartup/Chapters/ScheduledJobs.html

I have added a commit and released 1.7 to include RunAtLoad true in the launch agents. Thanks for the idea!

@bandgeekdante
Copy link
Author

Thanks @katernet! I don't think you need RunAtLoad for both launch agents though since they both just call the darkmode bash script (for example on Mondays that would trigger the solar times to be updated twice I think, though I haven't tested that)

@katernet
Copy link
Owner

You're right, the script only needs to run once on load and having it in both will cause the script to run twice on login. I'll re-commit when I am back at my computer.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants