GNOME Bugzilla – Bug 435820
Add keyboard shortcuts to action
Last modified: 2009-12-14 19:05:40 UTC
Interresting feature proposed by Kai on the official website. Need to check if Nautilus allow this or not ?
*** Bug 604039 has been marked as a duplicate of this bug. ***
Nautilus has its own keybindings (e.g. Ctrl+h to show hidden files), but doesn't redirect them to loaded extensions. More, Nautilus doesn't let its extensions define their own key bindings : the API only defines menu item properties. But you may always define global Gnome key bindings, which is probably what you actually want. See for example [1] or [2]. [1] http://www.linuxformat.co.uk/wiki/index.php/Setting_Key_Bindings_in_GNOME [2] http://ubuntuforums.org/showthread.php?t=79560
Indeed, but how is one supposed to obtain the functionality that nautilus actions keybindings would? This is a mayor feature and in my opinion it shouldn't be just dropped away with such ease. At least, an API for manipulating nautilus actions should be created, so one could use the native keybinding setting system.
I may have badly understood what you want. Could you please describe with more details ? As Gnome lets the user attach almost any keys combination to a command, I don't well see what N-A could add to this ? I may define an API to manipulate (create, delete) N-A actions. But what sort of use case this API should it address ?
Well, I think it was my wrong doing not mentioning explicitly what I wanted, I just assumed you knew because someone tagged my bug report as a duplicate of this one. What I was talking about was a way in which one could call nautilus actions with keybindings, respecting each actions parameters and everything. These were supposed to be set in nautilus directly, but now that you mentioned the api idea, something else occurred to me. An application could be created that would call an action (by its name, id, or whatever) and nautilus would attempt to satisfy its parameters, if nautilus was running. For example, I have installed this new gloobus product, which allows to quickly preview files and folder contents by just pressing <Control>space. Now, the problem is that there is no way to give this application a selected file as parameter, since it has to be called from a GNOME keybinding configuration section. But if an action was created for this gloobus application, with a parameter pointing to the selected file in nautilus (something nautilus actions can do effortlessly), the problem would now be setting a keybinding to call that action. The application I mentioned above would handle this. Now this can be an addon or whatever.
First, we should keep in mind that N-A is an extension of Nautilus file manager. As such, it heavily depends of Nautilus, in particular to get the current selection. From Nautilus point of view, N-A is just one among other menu providers. Nautilus never explicitly calls N-A, nor asks for a particular action be executed. And, of course, N-A cannot trigger any internal function of Nautilus. So, yes, we could create a tool to execute a given action (e.g. "preview in Gloobus"), but I don't see how this tool would be able to get the current selection, as it would be ran outside of Nautilus. For what I know, Nautilus maintainers have had some projects to publish the current selection via Dbus, which could do the trick. But I'm not conscious of any mature development of such a branch. Humm... These were the cons. There may be a pro. As a side effect of the current implementation of Nautilus, a menu provider is able to track the selection, even when the user doesn't ask to display any context menu. Maybe something to do with that... I have to ask to Nautilus guys what are their projects in this matter.
Well, I guarantee you that if nautilus actions could be called with a keyboard shortcut then what I am thinking about could be accomplished. That is all there is to do. Take into account that nautilus-actions-config provides parameters to retrieve the current selection, among others. For example, a parameter to the current file's path would be indicated with the following syntax: [executable %d/%f], where d is base directory and f is the filename. I am sorry if I used any incorrect terminology in my previous post.
Nautilus actions can already be called with a keyboard shortcut, provided that the user assigned one.
Do you mean "activating an action", or executing nautilus-actions-config-tool ? I'm not conscious of any current way to execute an action, as defined in NACT, with a keyboard shortcut.
I meant activating an action. And yes, there is no current way to execute an action, which is the purpose of this bug report: suggesting its implementation.
@Wolter: this is fixed in master, and will be part of next (unstable) release. Thanks to having forced me to imagine a way to do this :) My question was for Holger: see comment #8 above.
Awesome news! Thanks for hearing me out :)