Skip to content

Dragging multiple files on a starter starts multiple instances (should be: multiple arguments)

When I select two files on the desktop to drag and drop them on my starter, which looks like this ...

[Desktop Entry]
Version=1.0
Type=Application
Name=testdnd
Comment=
Exec=/home/christoph/testdnd.sh %F
Icon=
Path=/home/christoph
Terminal=true
StartupNotify=false
GenericName=testdnd
X-Desktop-File-Install-Version=0.23

Here's the testdnd.sh script:

#!/bin/bash
echo 'testdnd.sh'
echo 'First two arguments:'
echo '$1: ' $1
echo '$2: ' $2
read -rsn1

... there will be two instances (terminals) launched, each one gets one file name as an argument. The second argument is empty.

According to the Desktop Entry Specification, ...

https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html#exec-variables

%F - A list of files. Use for apps that can open several local files at once. Each file is passed as a separate argument to the executable program.

... there should be only one instance getting both file names as arguments.

I noticed the behaviour in version 4.12 and it has been confirmed with the version from the current git tree in the forums: https://forum.xfce.org/viewtopic.php?pid=60265