From 6ef0c0192be4b579cdf48f2a9c3c1938ce3ac9df Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Mon, 29 Jun 2026 15:04:57 -0500 Subject: [PATCH] Resolve launcher device icons --- shell/plugins/launcher/Launcher.qml | 9 +++++---- test/shell.d/launcher-search-test.sh | 5 +++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/shell/plugins/launcher/Launcher.qml b/shell/plugins/launcher/Launcher.qml index b96c970c..7429a4ad 100644 --- a/shell/plugins/launcher/Launcher.qml +++ b/shell/plugins/launcher/Launcher.qml @@ -173,15 +173,16 @@ Item { } function iconIndexScanCommand() { - // List app icons across the XDG icon dirs and /usr/share/pixmaps as - // "" lines. SVGs are emitted before PNGs so the parser, which keeps - // the first hit per name, prefers a scalable icon over a fixed-size one. + // List app/device icons across the XDG icon dirs and /usr/share/pixmaps as + // "" lines. Some desktop entries, such as Print Settings, use device + // icons like "printer" instead of app icons. SVGs are emitted before PNGs + // so the parser, which keeps the first hit per name, prefers scalable icons. return [ 'dirs="$HOME/.icons $HOME/.local/share/icons";', 'IFS=":"; for d in ${XDG_DATA_DIRS:-/usr/local/share:/usr/share}; do dirs="$dirs $d/icons"; done; unset IFS;', 'for ext in svg png; do', ' for base in $dirs; do', - ' [ -d "$base" ] && find "$base" -path "*/apps/*" -name "*.$ext" 2>/dev/null;', + ' [[ -d $base ]] && find "$base" \\( -path "*/apps/*" -o -path "*/devices/*" \\) -name "*.$ext" 2>/dev/null;', ' done;', ' find /usr/share/pixmaps -maxdepth 1 -name "*.$ext" 2>/dev/null;', 'done' diff --git a/test/shell.d/launcher-search-test.sh b/test/shell.d/launcher-search-test.sh index bab87630..c52ddf1f 100644 --- a/test/shell.d/launcher-search-test.sh +++ b/test/shell.d/launcher-search-test.sh @@ -114,4 +114,9 @@ assert( activateMatch[1].includes('gtk-launch') && activateMatch[1].includes('Util.hyprExecCommand'), 'launcher routes desktop entry launch through Hyprland' ) + +assert( + /function iconIndexScanCommand\(\)[\s\S]*-path "\*\/apps\/\*" -o -path "\*\/devices\/\*"/.test(launcherQml), + 'launcher fallback icon index includes device icons' +) JS