qubes-linux-template-builder/appmenus/convert_app2template.sh
Marek Marczykowski 0e6508982d Include templates for all appmenus in package (#266)
Convert it to actual appmenus at rpm installation stage - respecting provided
whitelist.
2011-07-11 20:39:58 +02:00

24 lines
623 B
Bash
Executable File

#!/bin/sh
SRC=$1
DSTDIR=$2
DST=$DSTDIR/$(basename $SRC)
if ! grep -q ^Name $SRC ; then
echo "WARNING: app $SRC doesn't have Name keyword, skipping..."
exit 0
fi
sed -e "s/^\(Name.*\)=\(.*\)/\1=%VMNAME%: \2/" \
-e "s/^\(GenericName.*\)=\(.*\)/\1=%VMNAME%: \2/" \
-e "s/^Exec=\(.*\)/Exec=qvm-run -q --tray -a %VMNAME% \'\1\'/" \
<$SRC | \
grep -v "^Mime" | \
grep -v "^Icon" | \
grep -v "^TryExec" | \
grep -v "^OnlyShowIn" | \
grep -v "^NotShowIn" | \
grep -v "^Startup" >$DST
echo X-Qubes-VmName=%VMNAME% >> $DST
echo Icon=%VMDIR%/icon.png >> $DST