You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
qubes-linux-template-builder/convert_app2template.sh

20 lines
520 B

#!/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 -n -e "/^\[Desktop Entry\]$/p" \
-e "s/^\(Name.*\)=\(.*\)/\1=%VMNAME%: \2/p" \
-e "s/^\(GenericName.*\)=\(.*\)/\1=%VMNAME%: \2/p" \
-e "s/^Exec=\(.*\)/Exec=qvm-run -q --tray -a %VMNAME% \'\1\'/p" \
-e "/^Comment.*=/p" \
-e "/Categories=/p" <$SRC >$DST
echo X-Qubes-VmName=%VMNAME% >> $DST
echo Icon=%VMDIR%/icon.png >> $DST