How to change default application if it is missing in "other applications list"? [duplicate]

I am currently trying to use texstudio as the default application for opening *.tex files, but I cannot change the default application associated with that file type.

I tried to change it by right-clicking on the .TEX file, then Properties, Open with, Show other applications. However, neither texmaker nor texstudio will appear in the programs list and oddly enough, there is no "add application" button anymore.

I tried to make an entry in my /home/user/.local/share/applications/mimeapps/mimeapps.list but nothing happened.

Is there no way to change the list of "other applications" or add an default application program manually?


From what I've read here:

Create an texstudio.desktop file in ~/.local/share/applications/ with the following content:

[Desktop Entry]
Name=TexStudio
Comment=Edit TEX files
Exec=texstudio %f
Terminal=false
Type=Application
Icon=texstudio
Categories=TextEditor;
StartupNotify=true
MimeType=text/x-text;

On file browser, you can right click a .tex file for the context menu and choose Open With -> Other Application. Click on Show other applications and you should see this dialog with this:

Choosing Texstudio

You may have to change the Exec line, I am not sure if that would be the right application name.


What you need it to add this line to ~/.local/share/applications/defaults.list

text/x-tex=TEXOPENNER.desktop

which in your case is:

text/x-tex=texmaker.desktop

That should work.

:-)