Binary name in the desktop file

Dominique Michel dominique.michel at vtxnet.ch
Thu Dec 26 09:52:36 PST 2013


Le Thu, 26 Dec 2013 10:56:11 +0000,
Jerome Leclanche <adys.wh at gmail.com> a écrit :

> 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.%f

You can put this into a wrapper script, and call the script from the
desktop file.

In fvwm-crystal, sh scripts are created from the desktop files, and the
application menu call these sh scripts instead of the desktop files.
These sh scripts can be customized or masked at the system and user
level, and custom scripts can be added at both levels, which give a
total freedom to both the sysadmin and the user.

Dominique

> 
> 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
> _______________________________________________
> xdg mailing list
> xdg at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/xdg


More information about the xdg mailing list