qubes.GetAppmenus 522 B

1234567891011
  1. #!/bin/sh
  2. # shellcheck disable=SC2016
  3. find /usr/share/applications/ /usr/local/share/applications/ -name '*.desktop' -print0 2>/dev/null | \
  4. xargs -0 awk '
  5. BEGINFILE { entry="" }
  6. /^\[/ { if (tolower($0) != "\[desktop entry\]") nextfile }
  7. /^Exec=/ { entry = entry FILENAME ":Exec=qubes-desktop-run " FILENAME "\n"; next }
  8. /^NoDisplay *= *true$/ { entry=""; nextfile }
  9. /=/ { entry = entry FILENAME ":" $0 "\n" }
  10. ENDFILE { print entry }
  11. ' 2> /dev/null