3

I have a script that I want to be available for the "Open With..." context menu for Nautilus (or less helpfully, "Files") running in Gnome Shell.

I've created a .desktop file and registered it with the MIME type inode/directory, which works find for all dirs, but I can't find how to also make it work for all files.

The spec offers no help here.

I don't want to list every conceivable MIME time because someone will only go and conceive of a new one ;-)

I've tried inode/all and inode/* to no avail.

Aside: Why?

It's a helper for a heterogeneous network.

This script takes the filepath and, if it can be recognised as a path on one of our servers, it creates a Windows SMB filepath and puts it on the clipboard. This enables users to email eachother filepaths that are openable on Windows. When other Ubuntu users receive these filepaths I use another script to turn them back into suitable filepaths and open that up in Nautilus/Nemo/Thunar/... So Ubuntu users can right-click any file, and choose "Copy Windows Filepath" which will run this script. This is why it needs to be available for any MIME type.

artfulrobot
  • 8,413
  • 12
  • 64
  • 92
  • 1
    Why do you not use Nautillus-Scripts https://help.ubuntu.com/community/NautilusScriptsHowto ? – TuKsn May 01 '14 at 10:15
  • Because I didn't know about it :-) Actually I use Nautilus Actions but this question is really because I want to move away from that (because there's no Nemo Actions package). – artfulrobot May 01 '14 at 10:38
  • @Simptnon Ah. And Nautilus-Scripts does not [seem to be supported](http://askubuntu.com/questions/190535/is-it-possible-to-use-nautilus-actions-with-nemo-a-nautilus-fork) by Nemo either. I suppose I'm asking about the general case that should work for any file manager, not just nautilus. – artfulrobot May 06 '14 at 16:43

2 Answers2

1

The Nemo file Manager has actions for a while now and you're going to be happy to hear this includes Selection=any and also Extensions=any!!!

Fabby
  • 34,341
  • 38
  • 97
  • 191
  • @artfulrobot: did you ever check this out? (Just got an upvote and whould like it as the accepted answer) **;-)** – Fabby Mar 30 '16 at 08:32
  • Ok, so I'm not using Nemo at the moment, but this does not work in Nautilus. In fact Nautilus seems pretty broken wrt mime type desktop files from what I can figure. – artfulrobot Apr 05 '16 at 08:56
  • Sorry to hear that: I gave up on Nautilus more then a year ago as it just doesn't do what I want it to do... Want me to delete my answer? Alternatively, you should check out [Nemo without Cinnamon dependencies](http://www.webupd8.org/2013/10/install-nemo-with-unity-patches-and.html) – Fabby Apr 05 '16 at 10:19
  • I prefer nemo too but for ease of deployment across many PCs in sticking with nautilus. Don't delete your answer, it's great that nemo had this feature – artfulrobot Apr 05 '16 at 10:21
  • If you're in charge of the deployment of those PCs, you *really should* got for Nemo. **:p ;-)** If you're not, ... well... I'll *pray* for you and burn a candle... **;-)** – Fabby Apr 05 '16 at 10:24
0

Try mimetype application/octet-stream for all Files.

Found that on https://techbase.kde.org/Development/Tutorials/Creating_Konqueror_Service_Menus

and using it in .desktop files for Kde Servicemenus.

jTux
  • 1