4

Using LXQT, the file manager (PCManFM-QT) is showing all files with unrecognized suffixes as "text/plain". I've added an entry to /etc/mime.types mapping a new suffix to a new application/x-app-here type, but the file still show up as plain text. I'd like to be able to map these files to the correct application without launching that app by default for all plaintext files. What am I missing?

guiverc
  • 33,561
Mark Reed
  • 231

1 Answers1

3

The solution is to register a new type with XDG using xdg-mime. Create an XML file like this:

<?xml version="1.0" encoding="UTF-8"?>
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
    <mime-type type="application/x-foobar">
        <comment>foo file</comment>
        <icon name="application-x-foobar"/>
        <glob-deleteall/>
        <glob pattern="*.foo"/>
    </mime-type>
</mime-info>

Name it x-foobar.xml in this case, and run sudo xdg-mime x-foobar.xml to activate the new type.

Mark Reed
  • 231