fixed issue when desktop has multiple matches

This commit is contained in:
willifan 2024-04-07 20:19:41 +02:00
parent f46ab5cf14
commit 59b1b362e2

View file

@ -27,6 +27,7 @@ getIcon() {
desktop=$(getIcon "$1" "$2") desktop=$(getIcon "$1" "$2")
if [ -n "$desktop" ]; then if [ -n "$desktop" ]; then
desktop=$(echo "$desktop" | awk 'NR==1')
icon=$(awk -F'[[:space:]]*=[[:space:]]*' '/Icon[[:space:]]*=/ && !seen[$2]++ {print $2; exit}' "$desktop") icon=$(awk -F'[[:space:]]*=[[:space:]]*' '/Icon[[:space:]]*=/ && !seen[$2]++ {print $2; exit}' "$desktop")
echo -n "${icon}.svg" echo -n "${icon}.svg"
fi fi