Request for clarification on menu/file spec
Waldo Bastian
bastian at kde.org
Fri Feb 3 04:03:53 EET 2006
On Thursday 02 February 2006 13:42, Jeremy White wrote:
> 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:
>
> http://standards.freedesktop.org/menu-spec/latest/apc.html
>
> 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).
datadir is an autoconf-ism, the implicit assumption here is that a binary is
installed to {prefix}/bin and it's data files to locations under
{prefix}/share. E.g. an application would install manpages to {datadir}/man
Note that this doesn't really consider the case of installing software in a
user's home directory.
> I take the definition of datadir to be the value
> XDG_DATA_HOME if geteuid() != 0,
Yes, that's a good assumption.
> 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 :-/).
Not sure if it's a typo in your e-mail, but it is /usr/local/share,
not /usr/share/local.
Can it be that the sytems that you have tested that fail to respond to files
placed in /usr/local/share/applications, fail to notice the new directory? Do
they recognize new files in that directory after a restart?
> 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 :-/.
>
> Cheers,
>
> Jeremy
Cheers,
Waldo
More information about the xdg
mailing list