From 67edd7ebbcfd7fcf43f6d3d50ff96d34454eb95f Mon Sep 17 00:00:00 2001 From: deadvey Date: Thu, 12 Dec 2024 16:11:47 +0000 Subject: [PATCH] 2024-12-12 16:11 : id 407 --- home-manager/home.nix | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) 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..."