diff --git a/scripts/sunset.sh b/scripts/sunset.sh index 873db0f..fb25f57 100755 --- a/scripts/sunset.sh +++ b/scripts/sunset.sh @@ -9,7 +9,7 @@ SUNSET_END="$((23 * 60 * 60))" # When to reach min temperature DAY_TEMP="6000" # Display temperature (K) to use in full daylight NIGHT_TEMP="2400" # Display temperature (K) to use at night -CURRENT="$(((($(date '+%H') * 60) + $(date '+%M')) * 60 + $(date '+%S')))" # Time in seconds since start of day +CURRENT="$(((($(date '+%-H') * 60) + $(date '+%-M')) * 60 + $(date '+%-S')))" # Time in seconds since start of day # Performs a calculation using an argument containing an input string calc() { @@ -61,4 +61,5 @@ else TEMP="$NIGHT_TEMP" fi +# TODO: Figure out a nice way to wait until Hyprland has properly started up before running this hyprctl hyprsunset temperature "$TEMP" diff --git a/systemd/sunset.timer b/systemd/sunset.timer index 2f2da6c..ac60c6b 100644 --- a/systemd/sunset.timer +++ b/systemd/sunset.timer @@ -6,6 +6,7 @@ After=hyprsunset.service [Timer] OnCalendar=*-*-* *:*:00 Persistent=true +AccuracySec=5s [Install] WantedBy=timers.target