Bug 178320 - kdelibs: use $XDG_CONFIG_DIRS (or $XDG_MENU_PREFIX)
Product: Fedora
Classification: Fedora
Component: kdelibs (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Ngo Than
: Reopened
Depends On:
  Show dependency treegraph
Reported: 2006-01-19 09:02 EST by Rex Dieter
Modified: 2007-11-30 17:11 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2006-09-30 07:03:52 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
upstream patch to enable use of XDG_MENU_PREFIX (1.11 KB, patch)
2006-12-07 09:28 EST, Rex Dieter
no flags Details | Diff

  None (edit)
Description Rex Dieter 2006-01-19 09:02:42 EST
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 14:05:35 EST
I cleaner implementation (that actually follows spec) would be to set  
$XDG_CONFIG_DIRS to point to a different location (holding applications.menu).  
Comment 2 Rex Dieter 2006-01-23 14:06:41 EST
It's vitally important this get fixed before (wide) deployment of menu 
Comment 3 Rex Dieter 2006-04-29 00:02:00 EDT
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 09:18:34 EDT
Have I mentioned this hack makes using $XDG_CONFIG_DIRS non-functional? (:
Comment 5 Rex Dieter 2006-05-03 10:17:14 EDT
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/kde-applications.menu

2.  Use this snippet in kdelibs.spec:
## menus 
pushd $RPM_BUILD_ROOT%{_sysconfdir}/xdg/menus/
mv applications.menu kde-applications.menu
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/kde-applications.menu applications.menu

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


I chose to do this in kdebase, creating
## from http://standards.freedesktop.org/menu-spec/latest/
# 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 Ngo Than 2006-05-04 13:47:42 EDT
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 12:35:33 EDT
Arg, I see kdelibs-3.4.0-menu.patch is back, which effectively disables the use
Comment 8 Rex Dieter 2006-07-18 12:38:51 EDT
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 kde-applications.menu).
Comment 9 Rex Dieter 2006-09-29 09:18:39 EDT
ping, any comment?

I'm (still) receiving reports about kiosktool not working correctly due to this.
Comment 10 Ngo Than 2006-09-30 07:03:52 EDT
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/env.sh
if [ -z "${XDG_MENU_PREFIX}" ] ; then
        export XDG_MENU_PREFIX

install KDE applications.menu into /etc/xdg/menus/kde-applications.menu

The fix will be included in next kdelibs-3.5.4-9.fc6.
Comment 11 Rex Dieter 2006-09-30 18:51:06 EDT
Nice, even better, thanks.
Comment 12 Rex Dieter 2006-12-07 09:27:17 EST
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 09:28:58 EST
Created attachment 143053 [details]
upstream patch to enable use of XDG_MENU_PREFIX
Comment 14 Ngo Than 2006-12-07 10:34:34 EST
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 13:51:23 EST
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.