diff --git a/home-manager/home.nix b/home-manager/home.nix index ef39b34..4b6bd1a 100644 --- a/home-manager/home.nix +++ b/home-manager/home.nix @@ -119,18 +119,15 @@ in text = '' #!/bin/bash # Set your latitude and longitude - LATITUDE="52.489471" - LONGITUDE="-1.898575" - - # Get current time in the format hh:mm - current_time=$(date +%H:%M) + LATITUDE="53.43N" + LONGITUDE="-1.89E" # Calculate the sunrise and sunset times for today using sunwait - light=$(sunwait poll) + light=$(sunwait poll $LATITUDE &LONGITUDE) echo $sunrise_time echo $sunset_time - if [[ "$current_time" > "$sunrise_time" && "$current_time" < "$sunset_time" ]]; then + if [[ "$light" == "DAY" ]]; then echo "It's daylight. Running daytime command..." else echo "It's night. Running nighttime command..."