Menu Spec: including files & absolute paths

Waldo Bastian bastian at
Wed Jul 21 12:40:04 EEST 2004

Hash: SHA1


I noticed that some tools generate ~/.config/menus/ files 
that include the system level file using an absolute path 
using <MergeFile>/absolute/path/</MergeFile>. This is 
actually recommended in appendix D of the spec.

I see the need for that and I also understand that it is hard to do this 
differently, unfortunately it also breaks the idea that the $XDG_CONFIG_DIRS 
variable controls which directories are used for the file: 
Once a ~/.config/menus/ file is in place that includes a 
system level file using its absolute path, changes in 
$XDG_CONFIG_DIRS will effectively be ignored. 

I think what is desired is a way to include the "next in command" file without hardcoding which one that is supposed to be.

With $XDG_CONFIG_HOME=~/.config (The default) and 
$XDG_CONFIG_DIRS=/dir1:/dir2:/dir3 the following locations will be searched 
for an file in order of precedence:

The first file that is found in the above list, is used.

What I think is needed, is a way for ~/.config/menus/ to say, 
please include the next file that you find in this list. Or 
in other words, the first file that exists out of the list:

And likewise, /dir1/menus/ should be able to say, please 
include the next one, which would then either 
be /dir2/menus/ or /dir3/menus/

To solve this issue in a backwards compatible way I suggest to add an argument 
to the <MergeFile> element that indicates that if the file that contains the 
element is a file relative to $XDG_CONFIG_HOME/$XDG_CONFIG_DIRS the same file 
further up the search path should be merged instead of the file that is 
specified in the <MergeFile> element. I propose to call this argument 

If you have currently in ~/.config/menus/


You would now use instead:

	<MergeFile parent="true" />

And in order to keep the current behavior for tools that don't support this 
new argument you may want to use:

	<MergeFile parent="true">/etc/xdg/menus/</MergeFile>

- -- 
bastian at  |   KDE Community World Summit 2004  |  bastian at
bastian at  | 21-29 August, Ludwigsburg, Germany |  bastian at
Version: GnuPG v1.2.2 (GNU/Linux)


More information about the xdg mailing list