Binary name in the desktop file

Jerome Leclanche adys.wh at gmail.com
Thu Dec 26 02:56:11 PST 2013


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

Oops. So there's a few things to comment on here, and a few potential changes.

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
implement.

3. Potential solution #2: Add a Binary key and add a %b token for the
Exec key so that you can do something like
Binary=/usr/bin/foo
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)...

I like #1 and #2. Would like some comments on this.

J. Leclanche


More information about the xdg mailing list