Request for clarification on menu/file spec

Jeremy White jwhite at
Thu Feb 2 23:42:39 EET 2006

I'm working on a new application for Linux.

I need to install it either as a user for one
user only, or as the root user to be shared by
all users.

I believe I have found a mildly incomplete
portion of the menu/file specification.

Specifically, if one is trying to write a menu to
a global location (i.e. into XDG_DATA_DIRS), it is
not clearly spelled out how to do that.

For example, this page:

Simply refers to 'datadir'; I could not find a definition
for datadir anywhere (feel free to wack me with the
clue bat if I just missed it).

I take the definition of datadir to be the value
XDG_DATA_HOME if geteuid() != 0, and then
I have taken it to be the first writeable directory
in the XDG_DATA_DIRS list for a global install.

That is, the spec calls for XDG_DATA_DIRS
to default to /usr/share/local:/usr/share,
but the systems I've tested with do not have
a /usr/share/local (and, what's more, they
don't respond to files placed in /usr/share/local/applications :-/).
Thus, I have an alogrithm that scans the list in
XDG_DATA_DIRS and uses the first directory
that has a writeable <dir>/applications/.

I guess the only hole in my algorithm is what
we're supposed to do if no directory in the
XDG_DATA_DIRS list exists; I suppose in that case,
we should simply use the first in the list?

If my analysis is correct, I'm willing to draw up a
patch to the draft, if someone wants to remind me
where I can get the source to it :-/.


-------------- next part --------------
A non-text attachment was scrubbed...
Type: application/x-shellscript
Size: 3320 bytes
Desc: not available
Url : 

More information about the xdg mailing list