diff options
| author | Danilo M. <danix@danix.xyz> | 2026-10-19 09:53:00 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-10-19 09:53:00 +0200 |
| commit | 47c2469aeb0e8f3ed40b995a560ab95ca1eb1074 (patch) | |
| tree | 320f6e1d1b888014f265c2a5413a89f84965b4bc /internal/notify/config.go | |
| parent | 7a4d76c5db3e7668796486a0a4d9db583f89b8e5 (diff) | |
| download | notifyd-47c2469aeb0e8f3ed40b995a560ab95ca1eb1074.tar.gz notifyd-47c2469aeb0e8f3ed40b995a560ab95ca1eb1074.zip | |
feat(notify): publish each notification's sound and suppress-sound
The sound-name lookup uses config.json's soundTheme, default freedesktop.
The quickshell settings page mirrors that key to gsettings; the daemon
only reads the file.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'internal/notify/config.go')
| -rw-r--r-- | internal/notify/config.go | 9 |
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) |
