Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at
Bug 178320 - kdelibs: use $XDG_CONFIG_DIRS (or $XDG_MENU_PREFIX)
Summary: kdelibs: use $XDG_CONFIG_DIRS (or $XDG_MENU_PREFIX)
Alias: None
Product: Fedora
Classification: Fedora
Component: kdelibs
Version: rawhide
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Than Ngo
QA Contact:
Depends On:
TreeView+ depends on / blocked
Reported: 2006-01-19 14:02 UTC by Rex Dieter
Modified: 2007-11-30 22:11 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2006-09-30 11:03:52 UTC
Type: ---

Attachments (Terms of Use)
upstream patch to enable use of XDG_MENU_PREFIX (deleted)
2006-12-07 14:28 UTC, Rex Dieter
no flags Details | Diff

Description Rex Dieter 2006-01-19 14:02:42 UTC
Not sure of the original motivation, but I think it's time has come and gone.  
1.  When in use, it doesn't show any subsubmenus, ie Office->More Applications 
2.  Wreaks havoc with menu editors, like kmenuedit and kiosktool

Comment 1 Rex Dieter 2006-01-23 19:05:35 UTC
I cleaner implementation (that actually follows spec) would be to set  
$XDG_CONFIG_DIRS to point to a different location (holding  

Comment 2 Rex Dieter 2006-01-23 19:06:41 UTC
It's vitally important this get fixed before (wide) deployment of menu 

Comment 3 Rex Dieter 2006-04-29 04:02:00 UTC
Problem being that if/when anyone *does* use a menu editor, menus can (not
always?) end up blank.

Only workaround is to undo any previous menu mods:
remove/rename ~/.config/menus
run: kbuildsycoca

Comment 4 Rex Dieter 2006-05-02 13:18:34 UTC
Have I mentioned this hack makes using $XDG_CONFIG_DIRS non-functional? (:

Comment 5 Rex Dieter 2006-05-03 14:17:14 UTC
Here's the implementation I've been using for awhile now in kde-redhat packaging:

1.  Drop use of 
Patch7: kdelibs-3.4.0-menu.patch
which hard-codes use of /etc/xdg/menus/

2.  Use this snippet in kdelibs.spec:
## menus 
pushd $RPM_BUILD_ROOT%{_sysconfdir}/xdg/menus/
ln -s applications-merged kde-applications-merged
## xdg.d/
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/xdg.d/kde/menus
pushd    $RPM_BUILD_ROOT%{_sysconfdir}/xdg.d/kde/menus
ln -s ../../../xdg/menus/

You could alternatively simply move /etc/xdg/menus/ to
/etc/xdg.d/kde/menus/ and skip the symlinks (I don't think they
help backward-compatibility-wise anyway).


I chose to do this in kdebase, creating
## from
# XDG_CONFIG_DIRS: where to look for menu config(s)
if [ -z "${XDG_CONFIG_DIRS}" ]; then

It's not completely clear to me (from reading the spec) whether including
/etc/xdg explicitly in XDG_CONFIG_DIRS is absolutely required, but I figured it
doesn't hurt either.

Comment 6 Than Ngo 2006-05-04 17:47:42 UTC
it's fixed in new kdelibs-3.5.2-3/kdebase-3.5.2-7. Thanks for your report.

Comment 7 Rex Dieter 2006-07-18 16:35:33 UTC
Arg, I see kdelibs-3.4.0-menu.patch is back, which effectively disables the use

Comment 8 Rex Dieter 2006-07-18 16:38:51 UTC
I suspect kdelibs-3.4.0-menu.patch was reintroduced, because of reported crashes
due to its removal (notably from users who had previously used kmenuedit and had
~/.config/menu bits referencing

Comment 9 Rex Dieter 2006-09-29 13:18:39 UTC
ping, any comment?

I'm (still) receiving reports about kiosktool not working correctly due to this.

Comment 10 Ngo Than 2006-09-30 11:03:52 UTC
ok, i have reread the menu-spec. We should avoid adding of extra directories for
KDE menu. I think the correct fix is to use XDG_MENU_PREFIX as in menu-spec .

there's the fix

cat /etc/kde/env/
if [ -z "${XDG_MENU_PREFIX}" ] ; then
        export XDG_MENU_PREFIX

install KDE into /etc/xdg/menus/

The fix will be included in next kdelibs-3.5.4-9.fc6.

Comment 11 Rex Dieter 2006-09-30 22:51:06 UTC
Nice, even better, thanks.

Comment 12 Rex Dieter 2006-12-07 14:27:17 UTC
Your idea of trying to use XDG_MENU_PREFIX was a good one, but unfortunately
kdelibs didn't support it (as of 3.5.5).  I'll attach a patch recently applied
upstream to address that, so that we can try it out.

Comment 13 Rex Dieter 2006-12-07 14:28:58 UTC
Created attachment 143053 [details]
upstream patch to enable use of XDG_MENU_PREFIX

Comment 14 Than Ngo 2006-12-07 15:34:34 UTC
yes i have seen the fix commited in 3.5 tree, it will be included in next 
kdelibs rebuild. I hope it will not cause any menu problem with 

Anyway thanks for your attached patch!

Comment 15 Rex Dieter 2007-01-10 18:51:23 UTC
I've confirmed that using XDG_MENU_PREFIX (with patch) now works as advertised.

Note You need to log in before you can comment on or make changes to this bug.