core-agent-linux/qubes-rpc/qubes.GetAppmenus
Marek Marczykowski-Górecki ce63d31a2e
Make all scripts in qubes-rpc executable
Don't rely on legacy feature of interpreting non-executable files as
scripts there.
2017-06-09 23:09:58 +02:00

11 lines
494 B
Bash
Executable File

#!/bin/sh
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