Menu Spec: including files & absolute paths

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


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

I noticed that some tools generate ~/.config/menus/applications.menu files 
that include the system level applications.menu file using an absolute path 
using <MergeFile>/absolute/path/applications.menu</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 applications.menu file: 
Once a ~/.config/menus/applications.menu file is in place that includes a 
system level applications.menu 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" 
applications.menu file without hardcoding which one that is supposed to be.

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

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

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

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


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 
"parent".

Example:
If you have currently in ~/.config/menus/applications.menu:

	<MergeFile>/etc/xdg/menus/applications.menu</MergeFile>

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/applications.menu</MergeFile>

Cheers,
Waldo
- -- 
bastian at kde.org  |   KDE Community World Summit 2004  |  bastian at suse.com
bastian at kde.org  | 21-29 August, Ludwigsburg, Germany |  bastian at suse.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)

iD8DBQFA/jn0N4pvrENfboIRAntpAJ9FDG42qXIz7v5lSVaHViYeBqtWWACeMZwf
09LSzB/ROMqljlBs/qVblBw=
=J0ld
-----END PGP SIGNATURE-----



More information about the xdg mailing list