Thursday, May 2, 2024
1
rated 0 times [  1] [ 0]  / answers: 1 / hits: 1389  / 2 Years ago, thu, january 13, 2022, 8:49:11

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.


More From » context-menu

 Answers
7

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



[#1381] Saturday, January 15, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
anatta

Total Points: 326
Total Questions: 128
Total Answers: 96

Location: Jordan
Member since Sun, Jun 26, 2022
2 Years ago
anatta questions
Sun, Jul 17, 22, 07:13, 2 Years ago
Sun, Jun 6, 21, 12:17, 3 Years ago
Sat, Jun 12, 21, 20:43, 3 Years ago
Sat, Jun 5, 21, 05:39, 3 Years ago
;