App Bundles

Stephen Paul Weber singpolyma at singpolyma.net
Wed Aug 26 15:25:04 PDT 2009


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

In some contexts, app bundles (where all files for an application live in
some folder, like on MacOS) are useful.  I've been thinking recently about
an app bundle layout that is based on freedesktop specs and also not
gratutitously different from the MacOS layout.  I share it here because
someone might like the idea, or have an even better one.

An app bundle is any directory containing a Contents folder which contains
an app.desktop file.

The icon for the bundle is the icon for the desktop entry.  Icons should be
searched for first in Contents/Resources and then according to the rest of
the icon theme spec.

The arch string for a system is:

`uname -s  | tr '[:upper:]' '[:lower:]'`-`uname -m`

uname -m should be normalised (i\d86, x86 => i386.  x86_64 => amd64)

When executing the bundle, read the Exec line in the normal way, but behave
as though Contents/`arch string` were prepended to path.

That is:

Exec=firefox %U

Will first try:

Contents/linux-i386/firefox

on my system.

The environment should be such that the current working directory is / and
the program has been invoked using it's absolute path (such that dirname $0
becomes the absolute path to the program).

The primary executeable should be encouraged to prepend `dirname
$0`/../Resources to XDG_DATA_DIRS in order to find its data.

To make this app bundle compatible with MacOS, the following must be
performed:

ln -s darwin-i386 MacOS

The content of the Exec line with % codes stripped is CFBundleExecutable.
Icon and Name may optionally also be extracted.
This data put into Info.plist in the correct XML format.

- -- 
Stephen Paul Weber, @singpolyma
See <http://singpolyma.net> for how I prefer to be contacted
edition right joseph
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iQIcBAEBCAAGBQJKlbZAAAoJENEcKRHOUZzeJnQQAMmNkGGD2X6nibemSmAdCQqo
tg/nGp5c4+Z2Np4G0xY/6FTD5amV+JloJJdJ3r/cAkVuvau/fkaZDmw+eEgWzblp
R9YiyGwPbJRq5tAmROe9/yIXFos8HEFGSl9XNzpukQ4TvPGdv3wv9SxjuhQD7tha
d4fSz1NFdhyGoMUBCRiph4070RIZoP6AFrNEcyCoUqrooA2XK8z1A9MKpClKwnG1
pnPkPX7Y5C0wNb2V71u7W8/pRMSJTIP6y8/Tn1t4lyideaQeXmEMtM5Xa0BIY+u4
sjc6pD/+u1cyUjfb5l4praiGh3iO1NXo+aNJTn20zmUPR646n5oJpsytzCPD3HRH
lEYtXrRIYlEkXHdgNKqdK8B/Un6QezScEuLP/BgvLrRTZZyOrlG6TXqtwBIREY7e
ezTEutaLy2K+nw20C3HlD0J8hRlUf/zybxPLDW6v/fC+JeWnnaphYWKCXsTIpFWF
3iLov4ZoG/pUaOAB64+DGctLjK6ywx++HbR/XvDkZqzmAm04ktlhWSVakF4iI0H+
GBDlB8odE3aoctPRblf3Wk6ct219NNkzTfPvrIO3f1yxHYm+ouI1ggRQjyLJ8Dks
PhQqubUygyDB/qonTLg6J+KMLVOAY903TNvIUxoTzKDWCItfLi3QQK9BKNw6sJae
FVyMAZ/dZsu2Fl3cxjS5
=Tuq9
-----END PGP SIGNATURE-----


More information about the xdg mailing list