You can try manually modifying the mimeapps.list
file which contains all custom file associations.
This file can be found in ~/.local/share/applications
or ~/.config
(I'm using Ubuntu 20.04 and the file is in ~/.config
. I'm not sure about 18.04, though).
Here is how you can proceed:
Find the name of the desktop entry for your Texmaker program:
Run this command in a terminal:
ls /usr/share/applications | grep -i tex
Look at the output and find something like:
texmaker.desktop
Open the mimeapps.list
file with a text editor. You will see something like this:
[Default Applications]
audio/mpeg=vlc.desktop
image/jpeg=qView.desktop
[Added Associations]
audio/ogg=vlc.desktop;celluloid.desktop;
Add the following line to the [Default Applications]
part:
text/x-tex=texmaker.desktop
The part would then look like this:
[Default Applications]
audio/mpeg=vlc.desktop
image/jpeg=qView.desktop
text/x-tex=texmaker.desktop
Save the file and you're done (remember to change texmaker.desktop
to the name that you found).
For reference, the line for .txt files will be something like:
text/plain=org.gnome.gedit.desktop
text/x-tex
- what is the output ofxdg-mime query default text/x-tex
? What do you get if you runfile --mime-type
on one of your files? – steeldriver Oct 02 '20 at 14:26text/plain
for .tex files andtext/x-tex
for .tex files – Pentaquark Oct 02 '20 at 14:45text/x-tex
mime type, then it should be possible to set the default association for it as described here: How are file-extensions/mime-types/icons/default applications associated? – steeldriver Oct 02 '20 at 15:23