appmenus: whitelist only some fields in desktop files (#694)

Use the same algorithm as qrexec version. Especially skip Display= field...
This commit is contained in:
Marek Marczykowski 2012-12-19 03:25:10 +01:00
parent b79aff95ac
commit d3187888d5

View File

@ -8,16 +8,11 @@ if ! grep -q ^Name $SRC ; then
exit 0 exit 0
fi fi
sed -e "s/^\(Name.*\)=\(.*\)/\1=%VMNAME%: \2/" \ sed -n -e "s/^\(Name.*\)=\(.*\)/\1=%VMNAME%: \2/p" \
-e "s/^\(GenericName.*\)=\(.*\)/\1=%VMNAME%: \2/" \ -e "s/^\(GenericName.*\)=\(.*\)/\1=%VMNAME%: \2/p" \
-e "s/^Exec=\(.*\)/Exec=qvm-run -q --tray -a %VMNAME% \'\1\'/" \ -e "s/^Exec=\(.*\)/Exec=qvm-run -q --tray -a %VMNAME% \'\1\'/p" \
<$SRC | \ -e "/^Comment.*=/p" \
grep -v "^Mime" | \ -e "/Categories=/p" <$SRC >$DST
grep -v "^Icon" | \
grep -v "^TryExec" | \
grep -v "^OnlyShowIn" | \
grep -v "^NotShowIn" | \
grep -v "^Startup" >$DST
echo X-Qubes-VmName=%VMNAME% >> $DST echo X-Qubes-VmName=%VMNAME% >> $DST
echo Icon=%VMDIR%/icon.png >> $DST echo Icon=%VMDIR%/icon.png >> $DST