qubes.GetAppmenus: skip unreadable .desktop files

This commit is contained in:
Saswat Padhi 2020-02-08 10:13:41 +00:00 committed by GitHub
parent 2f2067ac0b
commit 600df100df

View File

@ -58,7 +58,7 @@ fi
find "${apps_dirs[@]}" -name '*.desktop' -print0 2>/dev/null | \ find "${apps_dirs[@]}" -name '*.desktop' -print0 2>/dev/null | \
xargs -0 awk ' xargs -0 awk '
BEGINFILE { entry="" } BEGINFILE {if (ERRNO) nextfile; entry="" }
/^\[/ { if (tolower($0) != "\[desktop entry\]") nextfile } /^\[/ { if (tolower($0) != "\[desktop entry\]") nextfile }
/^Exec=/ { entry = entry FILENAME ":Exec=qubes-desktop-run " FILENAME "\n"; next } /^Exec=/ { entry = entry FILENAME ":Exec=qubes-desktop-run " FILENAME "\n"; next }
/^NoDisplay *= *true$/ { entry=""; nextfile } /^NoDisplay *= *true$/ { entry=""; nextfile }