[CentOS] Changing default file type in Centos 6

Sun Feb 28 21:02:51 UTC 2016
H <agents at meddatainc.com>

On February 28, 2016 1:14:08 PM EST, H <agents at meddatainc.com> wrote:
>On 02/28/2016 04:08 PM, Yamaban wrote:
>> On Sun, 28 Feb 2016 15:47, H <agents at ...> wrote:
>>
>>> On 02/27/2016 07:56 PM, Yamaban wrote:
>>>>  On Sat, 27 Feb 2016 19:38, H <agents at ...> wrote:
>>>>
>>>> >  It turns out my markdown files - extension .md - are of the 
>>>> "Genesis ROM" >  file type in Centos 6. Googling did not turn up
>any 
>>>> obvious places to >  change this in Gnome - neither in my local 
>>>> directory or in /etc/gnome.
>>>> > >  Where would I be able to change this default file type for 
>>>> files with the >  extension .md? I have already changed the default
>
>>>> application to geany >  (with the markdown extension.)
>>>> > >  Thank you.
>>>>
>>>>  have a look at these:
>>>>  /etc/mime.types (file)
>>>>  /usr/share/mime/ (dirs)
>>>>  /usr/share/mimelnk/ (dirs)
>>>>  /usr/share/mime-info (dir)
>>>>
>>>>  grep for '\.md' and/or for 'Genesis ROM' in there.
>>>>
>>>>  Just adding your own line to /etc/mime.types may look nice, but is
>
>>>> possibly
>>>>  not what you want, more likely a new entry in a file or directory 
>>>> under
>>>>  ~/.local/share/mime/
>>>>
>>>>  Have a nice weekend
>>>>   - Yamaban.
>>>>
>>> Files in ~/.local/share/mime also seem to have been automatically 
>>> generated by update-mime-database and should not be edited. Should I
>
>>> still create a new file for the ".md" extension and add it to this 
>>> directory?
>>
>> Huh? The "orignal" text/x-markdown file should already exist
>globally:
>>
>> /usr/share/mime/text/x-markdown.xml
>>
>> also generated from tis file:
>> /usr/share/mime/packages/freedesktop.org.xml
>>
>> but, feel free to do so:
>> [code]
>> mkdir -p ~/.local/share/mime/text
>> cp -t ~/.local/share/mime/text /usr/share/mime/text/x-markdown.xml 
>> [/code]
>>
>> or, create is yourself, short version content follows
>> (view mail as source or plain text if not shown)
>> [code]
>> <?xml version="1.0" encoding="utf-8"?>
>> <mime-type 
>> xmlns="http://www.freedesktop.org/standards/shared-mime-info" 
>> type="text/x-markdown">
>>   <comment>Markdown document</comment>
>>   <sub-class-of type="text/plain"/>
>>   <glob pattern="*.md"/>
>>   <glob pattern="*.mkd"/>
>>   <glob pattern="*.markdown"/>
>> </mime-type>
>> [/code]
>> _______________________________________________
>> CentOS mailing list
>> CentOS at centos.org
>> https://lists.centos.org/mailman/listinfo/centos
>No, I don't have x-markdown.xml, nor is markdown mentioned in 
>freedesktop.org.xml.
>
>I did follow your suggestion, first created the
>~/.local/share/mime/text 
>directory and then copied the code you listed into the file 
>x-markdown.xml into that same directory.
>
>Unfortunately the ".md" files still show as "plain text document" - is 
>there something else I should do?
>
>In the process I also lost the file type for pdf-documents which now 
>show as file type "unknown"...

Found the problem with the disappearing file type for pdf-documents: I had been too quick editing the freedesktop org.XML file which is now corrected.

I am still unable to have .md files displayed as markdown files - display as "text/plain type" - and in addition I seem to have lost my icons... Tried to back out but the icons are still absent. Clearly an edit I made caused this.