![]() Registered Member ![]()
|
I have a small collection of *.desktop files I use to override the system defaults.
I use the KDEDIRS environment variable to access those *.desktop files: KDEDIRS=/usr/local/kde_mods:/usr The directory structure under /usr/local/kde_mods is exactly the same as /usr. The KDEDIRS variable is working because I have some global service menus installed there and they all appear in both the Dolphin and Konqueror context menus. Yet when I add NotShowIn or OnlyShowIn in the *.desktop files the items still appear in the launcher menu (k-menu). For example, NotShowIn=KDE; or OnlyShowIn=XFCE;. When I copy the *.desktop files to the appropriate directory in /usr or $HOME/.local then the items disappear from the launcher menu and the NotShowIn and OnlyShowIn keys are recognized. Is this a bug or am (hopefully) missing something obvious? Thanks. ![]() |
![]() Administrator ![]()
|
If you run "kbuildsycoca4 --noincremental" with the options in question set, do you see any references to why KDE may consider the options invalid?
Make sure you enable all debug output first, using kdebugdialog.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
![]() Registered Member ![]()
|
Thanks for replying. I suspect I stumbled across a corner case type bug. I'm not an XDG guru therefore I won't speculate how the whole chain is supposed to work.
The short answer to your question is I haven't tried your test --- yet. ![]() Since I posted I did some more investigating. I believe the problem is related to the way XDG_DATA_DIRS is created in startkde. I start X from the command line (run level 3, Slackware 14.0). At that point the XDG_DATA_DIRS variable is not defined. Therefore a snippet at about line 265 in startkde creates the variable: XDG_DATA_DIRS="`kde4-config --prefix`/share:/usr/share:/usr/local/share" Incidentially, this results in the variable looking like this: XDG_DATA_DIRS="/usr/share:/usr/share:/usr/local/share" Seems there should be a basic integrity check to ensure /usr/share is not duplicated. My experience with the XDG_DATA_DIRS variable is not to try to guess how to define that variable. What seems apparent on my system is when the variable gets defined in startkde, the expanded KDEDIRS variable is overriden to some degree but not completely. I'm not done testing yet but thus far I explicitly tested defining the XDG_DATA_DIRS variable from an /etc/profile.d script, which then prevents the snippet in startkde from executing. That seems to work but I don't know whether that is the optimal solution. I suspect the proper way of creating that variable in startkde includes some sanity tests that include KDEDIRS. I still need to run a test of commenting out the startkde snippet to see whether KDEDIRS is then observed fully. |
![]() Registered Member ![]()
|
I tested startkde without the XDG_DATA_DIRS snippet and everything worked according to the KDEDIRS variable, which in my case is KDEDIRS=/usr:/usr/local/kde_mods.
According to this page, if set then XDG_DATA_DIRS should be set to /usr/local/share/:/usr/share. The current snippet in startkde has that backwards, along with the duplicate /usr/share. However, I know from working on another project that XDG_DATA_DIRS should be explicitly set only when software is installed in a non-standard location, such as /opt. In other words, XDG_DATA_DIRS should not be set at all in startkde when `kde4-config --prefix` == /usr. That way the KDEDIRS variable gets to function correctly. I propose startkde be updated to something like this:
|
![]() Administrator ![]()
|
Patches to improve parts of KDE are always welcome. I suggest cloning KDE Workspace from KDE anongit, and then submitting a patch for this on Reviewboard at https://git.reviewboard.kde.org/
In regards to XDG_DATA_DIRS - If you have multiple directories in KDEDIRS, then you need to make sure each of them is accounted for in XDG_DATA_DIRS. You therefore need to add /usr/local/kde_mods/share into it.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
![]() Registered Member ![]()
|
I believe the opposite is required. ![]() I'm running my system under these same conditions. That is, I applied the changes I mentioned above to startkde, and left my KDEDIRS variable as originally assigned with the additional directory. Everything works with no fiddling at all. I would like to submit a patch at the URL you provided, but am unable to login. I tried both my forum handle and my forum email address and neither work. I can login to the forum and bug tracker. Edit: I finally logged in. ![]() |
![]() Administrator ![]()
|
In this case, any path where KDE plugins, applications or other items which use *.desktop files are stored should be included in both XDG_DATA_DIRS and KDEDIRS.
When making your review, please make sure to include either the kde-workspace or kde-core-devel groups.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
Registered users: Bing [Bot], Google [Bot], kde-naveen, Sogou [Bot], Yahoo [Bot]