From 1e70e552db6790f2fd07fdd1721bf6cf76e0c6b3 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Mon, 19 Oct 2026 09:15:53 +0200 Subject: feat(notify): take the per-urgency default timeout from config Co-Authored-By: Claude Opus 5.5 --- internal/notify/service.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'internal/notify/service.go') diff --git a/internal/notify/service.go b/internal/notify/service.go index a2bf103..b29a783 100644 --- a/internal/notify/service.go +++ b/internal/notify/service.go @@ -39,10 +39,11 @@ type Service struct { mu sync.Mutex timers map[uint32]*time.Timer + cfg Config } func NewService(conn *dbus.Conn, dir string) *Service { - s := &Service{conn: conn, dir: dir, timers: map[uint32]*time.Timer{}} + s := &Service{conn: conn, dir: dir, timers: map[uint32]*time.Timer{}, cfg: DefaultConfig()} s.store = NewStore(s.emitClosed, func(live, history []Popup) { if err := Publish(s.dir, live, history); err != nil { log.Printf("notifyd: publish: %v", err) @@ -102,7 +103,10 @@ func (s *Service) Notify(appName string, replacesID uint32, appIcon, summary, bo u := UrgencyFromHints(hints) tag := StackTagFromHints(hints) now := time.Now().UnixMilli() - ms := EffectiveTimeoutMS(expireTimeout, u) + s.mu.Lock() + timeouts := s.cfg.Timeouts + s.mu.Unlock() + ms := EffectiveTimeoutMS(expireTimeout, u, timeouts) // Spec priority is image-data > image-path > the deprecated icon_data. A // raw blob cannot be written until Add has assigned the id the filename is // derived from, so any raw tier is held in pendingImage. -- cgit v1.2.3