Use different default applications to open .txt and .ply files

I am using Ubuntu 20.04. As is known, .txt suffix is for plain text files, and .ply is for polygon meshes. However, I find that for some weird reason, the default application to open .txt and .ply are always the same on ubuntu. Whenever I set meshlab as the default app for .ply files, the systems defaults to opening .txt with meshlab as well; and if I change the default app for .txt to text editor, the systems opens .ply files by text editor as well. This is absurd...can anyone help me? Thanks.

1 Answer

The issue you have is that if you run a mimetype command on your .ply file, you'll obtain that it's a text/plain type. So, when you choose your default software for your file, you, in fact, choose for that mimetype.

These files are considered as plain text files.

According to that thread,

  1. Create a file anywhere (let's go for $HOME/ply-mime.xml)
  2. Copy paste that in it
 <?xml version="1.0"?>
<mime-info xmlns=' <mime-type type="application/extension-ply"> <comment>.ply file</comment> <glob pattern="*.ply"/> </mime-type>
</mime-info> 
  1. Run in your terminal xdg-mime install ply-mime.xml. Now, you can do your "Select Default software for". It might need you restart your computer. I'm not sure.

  2. You can delete $HOME/ply-mime.xml

1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like