bassmanitram / actions-for-nautilus

An extension to the Gnome "Files" file manager that allows you to add arbitrary actions to the file selection context menu.
Apache License 2.0
169 stars 16 forks source link

Add commands to top of context menu #64

Open logiclrd opened 5 months ago

logiclrd commented 5 months ago

Is it possible, or could it be made possible, to add options to the top of the context menu? I want to be able to double-click an image and have it open in the standard image viewer, but then to right-click it and directly have the option "Open in pinta" (for example). Currently, it seems the closest I can get with stock nautilus is "Open with Other Application" which then requires me to navigate a list of possibilities, and the closest I can get with actions-for-nautilus is an "Open with pinta" option way down at the bottom of the context menu. Or is there another option I haven't yet found?

bassmanitram commented 5 months ago

Hey Jonathan

Firstly thanks for using A4N.

In regards to putting items at the top of the context, the extensions API exposed by Nautilus for the context menu is fairly rudimentary. In particular there isn't a way to affect the general location of the A4N menu items within the menu as a whole, only their order within the section of the menu that Nautilus implicitly assigns to the extension (which is based on the order in which menu extensions are loaded... which I also have no control over except, possibly, alphabetically... which I'm already doing, the extension name starting with an 'A' 😁).

I'm also not aware of any other techniques of getting a second 'open with' entry to appear below the default one. Although you do see that sometimes (e.g. executable scripts can have a 'run' entry at the top of the menu), this is something internal to Nautilus and not part of the python API.

If you do find a solution to this, I'd love to know what it is.

Martin Bartlett

On Tue, Apr 30, 2024, 11:28 Jonathan Gilbert @.***> wrote:

Is it possible, or could it be made possible, to add options to the top of the context menu? I want to be able to double-click an image and have it open in the standard image viewer, but then to right-click it and directly have the option "Open in pinta" (for example). Currently, it seems the closest I can get with stock nautilus is "Open with Other Application" which then requires me to navigate a list of possibilities, and the closest I can get with actions-for-nautilus is an "Open with pinta" option way down at the bottom of the context menu. Or is there another option I haven't yet found?

— Reply to this email directly, view it on GitHub https://github.com/bassmanitram/actions-for-nautilus/issues/64, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADAKLWR5NL4XRUC5PODBGQLY75P4XAVCNFSM6AAAAABG74K52GVHI2DSMVQWIX3LMV43ASLTON2WKOZSGI3TAOJXGIZDGMY . You are receiving this because you are subscribed to this thread.Message ID: @.***>

logiclrd commented 5 months ago

That's disappointing but I had a suspicion that might be the case. :-) Thanks very much for the reply!