SUMMARY It looks like that kf5 does not honor the XDG_MENU_PREFIX environment variable at all. When I set it to another menu prefix, it won't read the menu file I want, but still read /etc/xdg/menus/kf5-applications.menu. Originally I found it in Kubuntu 16.04 and was wondering if it is a bug in Kubuntu or KDE, but this time I installed KDE (5.28.0) in Debian Stretch (9.6.0) and saw the same problem. Besides, in LxQT, which uses KDE Framework 5, has the same problem too. Not sure if this problem is in KF5 or Qt5. STEPS TO REPRODUCE 1. sudo add-key adv --keyserver keyserver.ubuntu.com --recv-keys 4CD565B5 2. sudo apt update; sudo apt install ezgo-menu 3. restart X window (by restarting displaying manager) and re-login 4. the XDG_MENU_PREFIX is set to "ezgo-" in /etc/X11/Xsession.d/33-ezgo-menu and the environment variable (examined by running 'env') is also set to "ezgo-". But it still reads kf5-applications.menu. 5. with root privileges, run cd /etc/xdg/menus mv kf5-applications.menu kf5-applications.menu.bak ln -s ezgo-applications.menu kf5-applications.menu and re-login, the ezgo menu worked. OBSERVED RESULT kf5-applications.menu is always used no matter what I set to XDG_MENU_PREFIX EXPECTED RESULT It should follow the environment variable XDG_MENU_PREFIX SOFTWARE/OS VERSIONS Windows: MacOS: Linux/KDE Plasma: (available in About System) KDE Plasma Version: 5.8.6 KDE Frameworks Version: 5.28 Qt Version: 5.7.1 ADDITIONAL INFORMATION
Created attachment 117024 [details] Screenshot -- wrong behavior The environment variable XDG_MENU_PREFIX=ezgo- but the application menu is still kf5 menu. (Attach another image for comparing later)
Created attachment 117025 [details] Screenshot -- the correct menu The correct menu was shown when I create a symbolic link "kf5-applications.menu" pointing to "ezgo-applications.menu", i.e., the system thinks my ezgo-applications.menu is kf5 menu. XDG_MENU_PREFIX does not matter at all.
I see XDG_MENU_PREFIX in locateMenuFile(), see https://cgit.kde.org/kservice.git/tree/src/sycoca/vfolder_menu.cpp#n731 But I am not sure if what you see is related to kservice or kded.
(In reply to Christoph Feck from comment #3) > I see XDG_MENU_PREFIX in locateMenuFile(), see > https://cgit.kde.org/kservice.git/tree/src/sycoca/vfolder_menu.cpp#n731 > > But I am not sure if what you see is related to kservice or kded. I've searched the code for many times, and didn't see anywhere forcing XDG_MENU_PREFIX to be "kf5-" either. However, even the environment variable is correctly set (to other value), kf5 would still look for kf5-applications.menu only. It does not act like this when in KDE 4.