Compare commits

...

2 commits

Author SHA1 Message Date
68b2e276c3
Make sunset timer more accurate 2025-03-27 01:37:33 -04:00
5c753ff5ec
Don't pad H/M/S from date
Caused occasional script failures, was it trying to interpret as octal?
2025-03-27 01:12:14 -04:00
2 changed files with 3 additions and 1 deletions

View file

@ -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"

View file

@ -6,6 +6,7 @@ After=hyprsunset.service
[Timer]
OnCalendar=*-*-* *:*:00
Persistent=true
AccuracySec=5s
[Install]
WantedBy=timers.target