If a .desktop entry is being added to the list of Menu items by its "Name" field, it should not be added again by its command or filename.
If it is being added by its command, it should not be added again by its filename.
According to the Desktop Entry Specification
https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html#exec-variables
the executable name or path of the executable may be quoted. This is not
properly respected when i3-dmenu-desktop extracts the command name from
the Exec entry.
Examples of values that fail and what they currently result in:
- "bar" -> "bar"
- "foo/bar" -> bar"
- "foo foobar/bar" -> "foo
- "foo\sbar" -> "foo\sbar"
- foo\sbar -> foo\sbar
- "foo\\\\bar" -> "foo\\\\bar"
The spec says:
“Implementations must take care not to expand field codes into multiple
arguments unless explicitly instructed by this specification. This means
that name fields, filenames and other replacements that can contain
spaces must be passed as a single argument to the executable program
after expansion.”
fixes#1240
In addition to 'name' and 'command', add a third entry type 'filename'
to list the filenames of the .desktop files (e.g., 'firefox.desktop'
would be display as 'firefox').
Command line option '--entry-type' can be specified multiple times.
fixes#930