09-02-2021, 04:40 PM
(09-01-2021, 09:32 PM)KreAch3R Wrote:(12-17-2020, 07:14 AM)Justindu Wrote: .......................
Hey, Justin, thanks for sharing this! I think I got it to work. Can you tell me which way you used to make it run on each startup?
EDIT: Well I liked the script too much and thought about making it better by adding dynamic geolocation using the GPS a lot of us have on our devices, and if that doesn't exist, IP based geolocation (needs internet). Retained the manual way though. And added a second way to get the sunrise/sunset values besides the astral module.
You can find my revision here:
https://github.com/KreAch3R/daynightlocation
I thought about running it in the startup and I'm using the common systemd service way.
I created an executable .sh that I run at startup - like so:
#!/bin/sh
#Updatesuntime.sh
#run this at startup. Add the line below before openauto launch in file /etc/xdg/lxsession/LXDE-pi/autostart
#@/home/pi/Updatesuntime.sh
DISPLAY=:0.0 XAUTHORITY=/home/pi/.Xauthority python3 /home/pi/Updatesuntime.py &