After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 435820 - Add keyboard shortcuts to action
Add keyboard shortcuts to action
Status: RESOLVED FIXED
Product: filemanager-actions
Classification: Other
Component: general
git master
Other All
: Normal enhancement
: ---
Assigned To: Nautilus-actions Maintainer(s)
Nautilus-actions Maintainer(s)
: 604039 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2007-05-04 13:15 UTC by Frederic Ruaudel
Modified: 2009-12-14 19:05 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Frederic Ruaudel 2007-05-04 13:15:39 UTC
Interresting feature proposed by Kai on the official website.

Need to check if Nautilus allow this or not ?
Comment 1 Pierre Wieser 2009-12-08 10:45:08 UTC
*** Bug 604039 has been marked as a duplicate of this bug. ***
Comment 2 Pierre Wieser 2009-12-08 11:15:35 UTC
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
Comment 3 Severo Raz 2009-12-08 18:54:47 UTC
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.
Comment 4 Pierre Wieser 2009-12-08 19:16:13 UTC
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 ?
Comment 5 Severo Raz 2009-12-08 20:58:55 UTC
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.
Comment 6 Pierre Wieser 2009-12-08 22:33:47 UTC
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.
Comment 7 Severo Raz 2009-12-09 06:30:13 UTC
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.
Comment 8 Holger Berndt 2009-12-14 14:55:04 UTC
Nautilus actions can already be called with a keyboard shortcut, provided that the user assigned one.
Comment 9 Pierre Wieser 2009-12-14 16:58:04 UTC
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.
Comment 10 Severo Raz 2009-12-14 17:15:46 UTC
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.
Comment 11 Pierre Wieser 2009-12-14 18:49:44 UTC
@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.
Comment 12 Severo Raz 2009-12-14 19:05:40 UTC
Awesome news! Thanks for hearing me out :)