1

I have developed an app "MonitorMe" for Ubuntu.

In ubuntu I have seen now Microsoft has added Open With VS Code in Context menu without using Nautilus Action.

I want to add an option in context menu of Ubuntu like "Open with monitorme". How do do it?

Thanks.

2 Answers2

1

If your application works on a certain type of file (a MIME type), you can write a .desktop file and associate your application with that MIME type; then it will be available in all file managers.

If you don't have any specific MIME type, you can cheat and use MIME type inode/directory, then you can open it from the context menu of directories.

Examples:

Minimalistic .desktop file

[Desktop Entry]
Type=Application
Name=MyApplication
Exec=myapp %f
Icon=myapp
GenericName=MyApplication that does cool things
Terminal=false
MimeType=inode/directory;

Move that file to /usr/share/applications to make it available for all users on your machine. If you create a .deb package from your application to distribute it, install the .desktop file to /usr/share/applications in your make install step and package it with your application.

Further Reading

HuHa
  • 3,385
0

In Ubuntu 20.04, you could still use nautilus actions, but in 21.04, this does not work anymore.

What still always worked are Nautilus scripts. You put your script (with the executable bit set) in ~/.local/share/nautilus/scripts. They will then appear as a submenu of a "Scripts" right-click menu item. The Ubuntu Community help page contains more information on how it works.

vanadium
  • 88,010