make-startupitem: fix {prepend,append}ExtraArgs for Exec without arguments

This commit is contained in:
Felix Schröter 2024-08-18 12:27:06 +02:00
parent bef98989a2
commit 498d662662
No known key found for this signature in database
GPG Key ID: 671E39E6744C807D

View File

@ -29,7 +29,7 @@ stdenv.mkDerivation {
target=${name}.desktop
cp ${package}/share/applications/${srcPrefix}${name}.desktop $target
${lib.optionalString (prependExtraArgs != [] || appendExtraArgs != []) ''
sed -i -r "s/(Exec=)([^ ]*) (.*)/\1\2 ${prependArgs}\3${appendArgs}/" $target
sed -i -r "s/(Exec=)([^ \n]*) *(.*)/\1\2 ${prependArgs}\3${appendArgs}/" $target
''}
chmod +rw $target
echo "X-KDE-autostart-phase=${phase}" >> $target