title: How can I quote filenames passed into Exec= in a .desktop file?
body: <p>I want to select multiple files in dolphin and copy their quoted paths to the clipboard.</p>
  <p>Without the quotes, a simple <code>.desktop</code> file with</p>
  <pre><code>Exec=echo &quot;%F&quot; | xclip -selection clipboard
  </code></pre>
  <p>placed in <code>~/.local/share/kservices5/</code> does the job of adding that action to the context menu.</p>
  <p>But how can I quote the filenames coming in via <code>%F</code>?</p>
  <hr />
  <p>In case you want to reproduce, here is the entire <code>.desktop</code> file. I got the idea from <a href="https://bits.mdminhazulhaque.io/linux/dolphin-plugin-copy-as-path.html" rel="nofollow noreferrer">https://bits.mdminhazulhaque.io/linux/dolphin-plugin-copy-as-path.html</a>.</p>
  <pre><code>[Desktop Action copy-path]
  Exec=echo &quot;%F&quot; | xclip -selection clipboard
  Name=Copy Path
  Icon=edit-copy
  
  [Desktop Entry]
  Actions=copy-path
  ServiceTypes=KonqPopupMenu/Plugin
  MimeType=all/all
  Type=Service
  X-KDE-Priority=TopLevel
  </code></pre>