diff options
| author | Danilo M. <danix@danix.xyz> | 2026-09-15 18:31:30 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-09-15 18:31:30 +0200 |
| commit | 8087086bc0a996e7dc020ba8bcf1332dd843f034 (patch) | |
| tree | f0fade4044cd29681670e54f7b9e80af8fce2f23 /internal/notify/service.go | |
| parent | d5812ffa717cad99e12752b719a024f06b72b6af (diff) | |
| download | notifyd-8087086bc0a996e7dc020ba8bcf1332dd843f034.tar.gz notifyd-8087086bc0a996e7dc020ba8bcf1332dd843f034.zip | |
fix(notify): route icon-like content images to the app-icon slot
Clients like kitty, mail and opencode send their icon through the content-image hint, so it drew as a large balloon preview. A theme-name source, an SVG, or a raster small on both sides now fills the app-icon slot instead; a larger raster (a screenshot) stays the preview. An app_icon already present keeps the slot.
Diffstat (limited to 'internal/notify/service.go')
| -rw-r--r-- | internal/notify/service.go | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/internal/notify/service.go b/internal/notify/service.go index 86918d4..a2bf103 100644 --- a/internal/notify/service.go +++ b/internal/notify/service.go @@ -120,7 +120,16 @@ func (s *Service) Notify(appName string, replacesID uint32, appIcon, summary, bo if r, ok := ImageDataFromHints(hints); ok { raw = r } else if path, ok := ImagePathFromHints(hints); ok { - n.Image = ResolveIcon(path) + resolved := ResolveIcon(path) + // An icon-like content image (a theme name, an SVG, a small raster) is + // the app icon clients like kitty send through this hint; a larger + // raster is a screenshot and stays the balloon preview. An app_icon + // already provided keeps the slot. + if IsIconImage(path, resolved) && n.Icon == "" { + n.Icon = resolved + } else { + n.Image = resolved + } } else if r, ok := IconDataFromHints(hints); ok { raw = r } |
