From eca2774bae841168afff8a435b5f8341cbdd6eb7 Mon Sep 17 00:00:00 2001 From: Hayden Hamilton Date: Wed, 3 Jun 2026 16:33:56 +0100 Subject: Alter sleep behaviour for date() // Previously this status would sleep all the way until the next day. // This worked fine until the device entered sleep/hibernation // // Therefore a limit was added. Not the ideal solution, // as if the device is woken within config.MaxSleep, // then the date will not update until some extra time has elapsed. // // TODO: a better solution if (until > config.MaxSleep) { until = config.MaxSleep } time.Sleep(until) --- config/config.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'config') diff --git a/config/config.go b/config/config.go index 6b52e8c..9487d30 100644 --- a/config/config.go +++ b/config/config.go @@ -1,6 +1,9 @@ package config // import "hhvn.uk/hbspbar/config" -import "image/color" +import ( + "image/color" + "time" +) // Bar height var H uint = 17 @@ -39,3 +42,6 @@ var FontYPad int = 1 // Space between status elements var StatusPad int = 15 + +// Maximum time.Sleep() allowed +var MaxSleep = time.Minute * 15 -- cgit v1.2.3