Skip to content

Use the desktop-entry hint's icon when a notification's app_icon is a path - #19031

Open
falkoro wants to merge 2 commits into
omacom:quattrofrom
falkoro:fix/omarchy-notification-desktop-entry-icon-fix
Open

falkoro wants to merge 2 commits into
omacom:quattrofrom
falkoro:fix/omarchy-notification-desktop-entry-icon-fix

Conversation

@falkoro

@falkoro falkoro commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

What changes

A notification whose sender passes a file path as app_icon showed a letter tile instead of the app's icon, even when the sender named itself in the desktop-entry hint. Chromium-based browsers do this: Brave sends its logo as a temp file and desktop-entry brave-browser, and its notifications showed "B".

Store.snapshot() took the first non-empty of app_icon, the -i icon name and the desktop-entry hint. A path in app_icon won, and normalise() then cleared it because it is not an icon name, so the hint was never read.

Now app_icon (or the -i name) is used only when it is an icon name; otherwise the desktop-entry hint is used. An icon name in app_icon still wins over the hint, and a path in the hint is still dropped. docs/notifications.md describes the new order.

Verification

  • bash test/shell.d/notifications-test.sh passes. It has one new assertion: a file:// app_icon with desktop-entry brave-browser gives brave-browser. Against the base Store.js that assertion fails with ''.
  • Sent the issue's two gdbus notifications and five more to a Quickshell NotificationServer running offscreen on a private D-Bus session, with a brave-browser.desktop (Icon=brave-desktop) in isolated XDG data, once with the base code and once with this change. Each went through Store.snapshot, Icons.candidates and the same DesktopEntries.heuristicLookup the card uses.
    • app_icon as a file:// URL or an absolute path, hint brave-browser: base stores no icon and falls back to a letter; with this change it stores brave-browser and the lookup finds brave-desktop.
    • An icon name in app_icon with a different hint: the name is kept, in both.
    • A path in app_icon with no hint, a path in the hint, or ../../etc/passwd in the hint: no icon stored and a letter tile, in both.
  • Not checked: the card as drawn in a running session. The offscreen run shows which icon the card resolves to, not pixels.

Screenshots

No screenshot: the card is a layer-shell surface that needs a running compositor, and this was verified offscreen only. The visible change is that such a notification shows the app's icon where it showed a letter tile.

Fixes #18912

@greptile-apps

greptile-apps Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] The PR appears safe to merge.

Summary

Fixes notification icons when app_icon contains a path.

  • Notifications use the app hint when their icon field is a file path.

Reviews (1) · Last reviewed commit: "no-mistakes(document): Document desktop-..." · Reviewed by Greptile

@falkoro falkoro changed the title fix(shell): use the desktop-entry hint's icon when a notification's app_icon is a path Use the desktop-entry hint's icon when a notification's app_icon is a path Nov 15, 2026
@omarchybot omarchybot added the bug Something isn't working label Nov 17, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Compared this head (d7dd7239) with #16206, including the notification snapshot, icon lookup, replacement and history paths, and the report in #18912. Both address the file-path fallback. The older PR checks all three icon candidates separately; this one can skip the intermediate icon name when app_icon is a path. I found no additional functional case here that the older fix misses.

The clarification in docs/notifications.md is worth keeping. I queued it to be folded into #16206 with credit to @falkoro, adjusted to describe its full candidate order. This PR stays open because the selection behavior differs and that documentation is not yet in the older PR.

Codex High reviewed the source. Opus 5.5 High and muse-wonder via pi, thinking high also compared both diffs and favored #16206; independence is not guaranteed. No runtime tests ran for this head: #16206 already carries ready, so this competing fix was not taken through worker verification. This waits on the maintainer's choice between them.

omarchybot added a commit to yamz8/omarchy that referenced this pull request Nov 17, 2026
Clarify that file paths give way to the next valid icon name. Fold the documentation idea from omacom#19031, with the wording adjusted for this fix's intermediate image://icon/ candidate.

Co-Authored-By: falkoro <39274208+falkoro@users.noreply.github.com>
Co-Authored-By: GPT-6 High <noreply@openai.com>
Co-Authored-By: Opus 5.5 High <noreply@anthropic.com>
@chessing234

Copy link
Copy Markdown
Contributor

@dhh @omarchybot the desktop-entry icon fallback for a path app_icon is in #21030, including the docs line. It landed next to the browser markup change and the button-hover fix, which all touch the same toast row.

Please consider closing this as superseded only after #21030 is accepted. Leaving the close to you.

@omarchybot

Copy link
Copy Markdown
Collaborator

I checked the notification code, regression test, and docs in #21030. That bundle was closed without merging, and quattro still has the icon fallback bug. #16206 remains the preferred fix for #18912 because it tries the image://icon/ name before falling back to the desktop-entry hint when app_icon is a file path. Its commit 93f20896 also includes the documentation clarification from this PR, with @falkoro credited as co-author. This PR stays open for the maintainer’s decision.

GPT-6 High in Codex checked the source, and Opus 5.5 High agreed on the choice of fix. Review independence is unverified. Tests were skipped for this competing fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Notifications: desktop-entry hint is ignored when app_icon is a file path, so the app shows a letter instead of its icon (4.5.0 regression)

3 participants