aboutsummaryrefslogtreecommitdiffstats
path: root/internal/notify/config.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/notify/config.go')
-rw-r--r--internal/notify/config.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/internal/notify/config.go b/internal/notify/config.go
index fcba5a8..98a6f51 100644
--- a/internal/notify/config.go
+++ b/internal/notify/config.go
@@ -29,16 +29,18 @@ type Timeouts struct {
// Config is the daemon's share of ~/.config/notifyd/config.json. The file
// also carries the balloon shell's keys (placement, DND, mute); they are not
-// declared here and the decoder ignores them.
+// declared here and the decoder ignores them. The daemon reads timeouts, caps
+// and the sound theme for sound-name hints.
type Config struct {
Timeouts Timeouts `json:"timeouts"`
LiveCap int `json:"liveCap"`
HistoryCap int `json:"historyCap"`
+ SoundTheme string `json:"soundTheme"`
}
// DefaultConfig is the behaviour before the file existed.
func DefaultConfig() Config {
- return Config{Timeouts: Timeouts{Low: 10, Normal: 10, Critical: 0}, LiveCap: 20, HistoryCap: 20}
+ return Config{Timeouts: Timeouts{Low: 10, Normal: 10, Critical: 0}, LiveCap: 20, HistoryCap: 20, SoundTheme: "freedesktop"}
}
// ConfigPath is $XDG_CONFIG_HOME/notifyd/config.json, ~/.config when unset.
@@ -74,6 +76,9 @@ func LoadConfig(path string) Config {
}
c.LiveCap = clamp(c.LiveCap, 1, 100)
c.HistoryCap = clamp(c.HistoryCap, 1, 100)
+ if c.SoundTheme == "" {
+ c.SoundTheme = def.SoundTheme
+ }
c.Timeouts.Low = seconds(c.Timeouts.Low, def.Timeouts.Low)
c.Timeouts.Normal = seconds(c.Timeouts.Normal, def.Timeouts.Normal)
c.Timeouts.Critical = seconds(c.Timeouts.Critical, def.Timeouts.Critical)