Avoid using bash in the emacsclient desktop file

* etc/emacsclient-mail.desktop (Exec): Use sh and sed instead
of bash, because the latter may not be available everywhere.
This commit is contained in:
Ulrich Müller 2023-03-08 19:37:27 +01:00
parent a588937094
commit c8ec0017cb

View file

@ -2,9 +2,9 @@
Categories=Network;Email; Categories=Network;Email;
Comment=GNU Emacs is an extensible, customizable text editor - and more Comment=GNU Emacs is an extensible, customizable text editor - and more
# We want to pass the following commands to the shell wrapper: # We want to pass the following commands to the shell wrapper:
# u=${1//\\/\\\\}; u=${u//\"/\\\"}; exec emacsclient --alternate-editor= --display="$DISPLAY" --eval "(message-mailto \"$u\")" # u=$(echo "$1" | sed 's/[\"]/\\&/g'); exec emacsclient --alternate-editor= --display="$DISPLAY" --eval "(message-mailto \"$u\")"
# Special chars '"', '$', and '\' must be escaped as '\\"', '\\$', and '\\\\'. # Special chars '"', '$', and '\' must be escaped as '\\"', '\\$', and '\\\\'.
Exec=bash -c "u=\\${1//\\\\\\\\/\\\\\\\\\\\\\\\\}; u=\\${u//\\\\\\"/\\\\\\\\\\\\\\"}; exec emacsclient --alternate-editor= --display=\\"\\$DISPLAY\\" --eval \\"(message-mailto \\\\\\"\\$u\\\\\\")\\"" bash %u Exec=sh -c "u=\\$(echo \\"\\$1\\" | sed 's/[\\\\\\"]/\\\\\\\\&/g'); exec emacsclient --alternate-editor= --display=\\"\\$DISPLAY\\" --eval \\"(message-mailto \\\\\\"\\$u\\\\\\")\\"" sh %u
Icon=emacs Icon=emacs
Name=Emacs (Mail, Client) Name=Emacs (Mail, Client)
MimeType=x-scheme-handler/mailto; MimeType=x-scheme-handler/mailto;
@ -16,7 +16,7 @@ Actions=new-window;new-instance;
[Desktop Action new-window] [Desktop Action new-window]
Name=New Window Name=New Window
Exec=bash -c "u=\\${1//\\\\\\\\/\\\\\\\\\\\\\\\\}; u=\\${u//\\\\\\"/\\\\\\\\\\\\\\"}; exec emacsclient --alternate-editor= --create-frame --eval \\"(message-mailto \\\\\\"\\$u\\\\\\")\\"" bash %u Exec=sh -c "u=\\$(echo \\"\\$1\\" | sed 's/[\\\\\\"]/\\\\\\\\&/g'); exec emacsclient --alternate-editor= --create-frame --eval \\"(message-mailto \\\\\\"\\$u\\\\\\")\\"" sh %u
[Desktop Action new-instance] [Desktop Action new-instance]
Name=New Instance Name=New Instance