Resolve launcher device icons
This commit is contained in:
@@ -173,15 +173,16 @@ Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function iconIndexScanCommand() {
|
function iconIndexScanCommand() {
|
||||||
// List app icons across the XDG icon dirs and /usr/share/pixmaps as
|
// List app/device icons across the XDG icon dirs and /usr/share/pixmaps as
|
||||||
// "<path>" lines. SVGs are emitted before PNGs so the parser, which keeps
|
// "<path>" lines. Some desktop entries, such as Print Settings, use device
|
||||||
// the first hit per name, prefers a scalable icon over a fixed-size one.
|
// 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 [
|
return [
|
||||||
'dirs="$HOME/.icons $HOME/.local/share/icons";',
|
'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;',
|
'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 ext in svg png; do',
|
||||||
' for base in $dirs; 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;',
|
' done;',
|
||||||
' find /usr/share/pixmaps -maxdepth 1 -name "*.$ext" 2>/dev/null;',
|
' find /usr/share/pixmaps -maxdepth 1 -name "*.$ext" 2>/dev/null;',
|
||||||
'done'
|
'done'
|
||||||
|
|||||||
@@ -114,4 +114,9 @@ assert(
|
|||||||
activateMatch[1].includes('gtk-launch') && activateMatch[1].includes('Util.hyprExecCommand'),
|
activateMatch[1].includes('gtk-launch') && activateMatch[1].includes('Util.hyprExecCommand'),
|
||||||
'launcher routes desktop entry launch through Hyprland'
|
'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
|
JS
|
||||||
|
|||||||
Reference in New Issue
Block a user