Changing EXEC path in .desktop makes launcher disappear

I used MenuLibre to append the EXEC path for the .desktop file of “Web” (workaround for a bug which prevents Epiphany from printing files).
This created the following .desktop file at /usr/share/applications/ org.gnome.Epiphany.desktop:

[Desktop Entry]
Type=Application
Name=Epiphany  #changed the name from 'Web'
GenericName=Web Browser
Comment=Browse the web
Icon=org.gnome.Epiphany
Exec=WEBKIT_FORCE_SANDBOX=0 epiphany %U  #bug workaround
Actions=new-window;Incognito;
MimeType=text/html;text/xml;application/xhtml+xml;x-scheme-handler/http;x-scheme-handler/https;multipart/related;application/x-mimearchive;message/rfc822;
Categories=GNOME;GTK;Network;WebBrowser;
Keywords=web;browser;internet;
StartupNotify=true

[Desktop Action new-window]
Name=New Window
Exec=epiphany --new-window

[Desktop Action Incognito]
Name=New Incognito Window
Exec=epiphany --incognito-mode

This made the Epiphany launcher entirely disappear from the Gnome menu.
How do I append the Exec variable in a .desktop file to get a functioning launcher?

desktop-file-install \
--dir=${HOME}/.local/share/applications \
--set-key=Exec \
--set-value="$(sed -n -r -e \
"s|^Exec=(.*\s%U)$|env WEBKIT_FORCE_SANDBOX=0 \1|p" \
/usr/share/applications/org.gnome.Epiphany.desktop)" \
/usr/share/applications/org.gnome.Epiphany.desktop

This amounts to Exec= env WEBKIT_FORCE_SANDBOX=0 epiphany
in the .desktop file?

This should help to:

  • Preserve the original config saving customization in the proper place.
  • Perform only the necessary modification avoiding possible typos.
  • Correctly notify DE about desktop config changes.