Registered Member
|
I've been playing around with .kde4/share/kde4/services/ServiceMenus/ quite a bit now. It's impressive what one can do with it together with a few custom bash-scripts and/or python scripts.
However. There is something I haven't been able to get working yet, and don't know if it's possible. (If it isn't, perhaps I should post another post in the ideas/suggestion parts of this forum). What I want: Show a custom context-menu based on specific paths (Current working directory?), but not outside those specific paths. Example: I have a folder writeable to all my users: /home/public (Yep. I placed it there since I want it to be in the users drive/partition, and follow the same backup as that drive/partition. It does not have any account associated with it though) When my users right-click anything inside this particular path, I want to show an additional set of options (scripts) in the context-menu that is only going to work on this particular path (And sub-directories) My question is simple: Can this be done? Because I haven't found out how to do it ... yet... if possible. Other suggestions that might work in a similar way are also welcome. Sure, I can just create the context-menu options no matter what and teach my users that those options will only work inside the "public" folder. But I prefer not to bog down the context-menu with options that won't work. |
Administrator
|
As far as I am aware, it isn't possible to limit the context menu entries in such a manner, unless you were to write your own plugin to Dolphin/Konqueror - which would allow you to do this (if it let's you add entries to the context menu).
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
Moderator
|
I think that Ben is right - writing a context menu plugin that adds actions to the menu based on the current path is probably the only solution. The base class for context menu plugins is KAbstractFileItemActionPlugin. Some documentation can be found at
http://api.kde.org/4.12-api/kdelibs-api ... lugin.html |
Registered users: Bing [Bot], gfielding, Google [Bot], markhm, sethaaaa, Sogou [Bot], Yahoo [Bot]