diff options
Diffstat (limited to 'internal/notify/service.go')
| -rw-r--r-- | internal/notify/service.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/internal/notify/service.go b/internal/notify/service.go index b29a783..1b1c89b 100644 --- a/internal/notify/service.go +++ b/internal/notify/service.go @@ -77,10 +77,21 @@ func (s *Service) Start() error { if err := os.RemoveAll(ImagesDir(s.dir)); err != nil { log.Printf("notifyd: clear images: %v", err) } + s.reload() s.store.Reset() return nil } +// reload re-reads the config file and applies it. Timers already armed keep +// their old lifetime; the next notification gets the new one. +func (s *Service) reload() { + c := LoadConfig(ConfigPath()) + s.mu.Lock() + s.cfg = c + s.mu.Unlock() + s.store.SetCaps(c.LiveCap, c.HistoryCap) +} + func (s *Service) emitClosed(id, reason uint32) { s.conn.Emit(dbus.ObjectPath(objPath), iface+".NotificationClosed", id, reason) } |
