From 9cb0d8baf2f5e8f479dba3f7401d102ad2722bb4 Mon Sep 17 00:00:00 2001 From: odt <15870533+odtgit@users.noreply.github.com> Date: Sat, 28 Feb 2026 21:41:28 +0100 Subject: [PATCH] feat(icons): support file path substitutions in getAppIcon (#1867) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Allow appIdSubstitutions to return absolute file paths (/, ~, file://) that bypass Quickshell.iconPath theme lookup. This enables users to map app IDs directly to icon files on disk via the existing substitution UI. Fixes PWA icon resolution for Chrome, Chromium and Edge PWAs where Qt's icon theme lookup fails to find icons installed to ~/.local/share/icons/hicolor/ by the browser. Example substitutions (Settings → Running Apps → App ID Substitutions): ^msedge-_(.+)$ → ~/.local/share/icons/hicolor/128x128/apps/msedge-$1.png ^(chrome|msedge|chromium)-(.+)$ → ~/.local/share/icons/hicolor/128x128/apps/$1-$2.png Tested with Chrome PWAs (YouTube, Twitch, ai-ta) and Edge PWAs (Microsoft Teams, Outlook) on niri/Wayland. Co-authored-by: odtgit --- quickshell/Common/Paths.qml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/quickshell/Common/Paths.qml b/quickshell/Common/Paths.qml index ffc23224..e0c1f417 100644 --- a/quickshell/Common/Paths.qml +++ b/quickshell/Common/Paths.qml @@ -78,6 +78,10 @@ Singleton { const moddedId = moddedAppId(appId); if (moddedId !== appId) { + if (moddedId.startsWith("~") || moddedId.startsWith("/")) + return toFileUrl(expandTilde(moddedId)); + if (moddedId.startsWith("file://")) + return moddedId; return Quickshell.iconPath(moddedId, true); }