core-agent-linux/qubes-rpc/qubes.GetAppmenus
adrianx64 d3966b0f6c Proposed solution for issue #1657
qvm-sync-appmenus fails when a shortcut have spaces in the file name #1657
2016-01-18 23:02:30 -06:00

10 lines
484 B
Plaintext

find /usr/share/applications/ /usr/local/share/applications/ -name '*.desktop' -print0 2>/dev/null | \
xargs -0 awk '
BEGINFILE { entry="" }
/^\[/ { if (tolower($0) != "\[desktop entry\]") nextfile }
/^Exec=/ { entry = entry FILENAME ":Exec=qubes-desktop-run " FILENAME "\n"; next }
/^NoDisplay *= *true$/ { entry=""; nextfile }
/=/ { entry = entry FILENAME ":" $0 "\n" }
ENDFILE { print entry }
' 2> /dev/null