diff --git a/install.sh b/install.sh index a690691..e4c99ec 100755 --- a/install.sh +++ b/install.sh @@ -202,10 +202,13 @@ read -rp "Enter your latitude (South values are negative): " read -rp "Enter your longitude (West values are negative): " lon=$REPLY +read -rp "Enter your timezone (Ex: -3 for Argentina time): " + timezone=$REPLY + sed -i -e "s/change_latitude/${lat}/g;s/change_longitude/${lon}/g" "$HOME/.noaa.conf" sed -i -e "s/change_latitude/${lat}/g;s/change_longitude/${lon}/g" "$HOME/.wxtoimgrc" sed -i -e "s/change_latitude/${lat}/g;s/change_longitude/$(echo "$lon * -1" | bc)/g" "$HOME/.predict/predict.qth" -sed -i -e "s/change_latitude/${lat}/g;s/change_longitude/${lon}/g" "sun.py" +sed -i -e "s/change_latitude/${lat}/g;s/change_longitude/${lon}/g;s/change_tz/$(echo "$timezone * -1" | bc)/g" "sun.py" # Running WXTOIMG to have the user accept the licensing agreement wxtoimg diff --git a/sun.py b/sun.py index ff40329..3454b29 100755 --- a/sun.py +++ b/sun.py @@ -2,8 +2,8 @@ import ephem import time import sys - -date = time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(int(sys.argv[1])+3*60*60)) +timezone = change_tz +date = time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(int(sys.argv[1])+(timezone*60*60))) obs=ephem.Observer() obs.lat='change_latitude'