Binary name in the desktop file
adys.wh at gmail.com
Thu Dec 26 03:33:13 PST 2013
On Thu, Dec 26, 2013 at 11:25 AM, Kevin Krammer <krammer at kde.org> wrote:
> On Thursday, 2013-12-26, 10:56:11, Jerome Leclanche wrote:
>> I'd really like to be able to get the binary name from desktop files
>> (eg a way to "start without any argument"). Current implementations
>> rely on getting the first word of the Exec key OR replace %f etc by
>> nothing, but that fails for things such as these:
>> Exec=env WINEPREFIX="/home/adys/.local/share/wineprefixes/default"
>> wine start /ProgIDOpen chm.file %f
> What do you mean when you say "fails"?
> That the command won't launch if %f is replaced by nothing or that taking the
> first string fails to see that the launched program is /usr/bin/env?
Sorry, I meant the usual way of getting the binary name (which in this
case would be "env").
>> 1. Add an Environment key to desktop files, like systemd's service
>> files. This would be neat and cleaner for such programs. That exec key
>> would trip up launchers that parse the command line in addition to the
>> name. Annoying! But it doesn't really fix my issue.
>> 2. Potential solution #1: Add an ExecNoArgs (or similarly named) key.
>> If not found, it would be assumed to be the same as the Exec key with
>> %f/%F/%u/%U replaced by nothing. Clean, backwards-compatible, easy to
>> 3. Potential solution #2: Add a Binary key and add a %b token for the
>> Exec key so that you can do something like
>> Exec=%b --files=%F
>> Not backwards compatible but more potential. On the other hand, this
>> could be inappropriately used for things such as wine (where Binary
>> would be /usr/bin/wine but should never be executed without args)...
> Not backward compatible is a no-go IMHO. It would take years before software
> vendors could use the new format.
> Kevin Krammer, KDE developer, xdg-utils developer
> KDE user support, developer mentoring
> xdg mailing list
> xdg at lists.freedesktop.org
More information about the xdg