aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--main.go10
1 files changed, 7 insertions, 3 deletions
diff --git a/main.go b/main.go
index 332e910..f4c4396 100644
--- a/main.go
+++ b/main.go
@@ -180,13 +180,17 @@ func main() {
t := time.NewTimer(30 * time.Second)
defer t.Stop()
+ prev := time.Now()
for {
select {
case <-quitC:
return
- case <-t.C:
- drawClock(scr, time.Now(), bgStyle, clockStyle)
- scr.Show()
+ case now := <-t.C:
+ if now.Minute() != prev.Minute() {
+ drawClock(scr, now, bgStyle, clockStyle)
+ scr.Show()
+ prev = now
+ }
}
}
}