In Dolphin/Konqueror files that are supposed to have "unknown" file type have "Microsoft Help Attribute Definition File" as their type.
This also affect files without extension with special symbols in them(such as ^[[2J^[[0;0f I have at the begnning of .xsession-errors), swapfile, softlinks(to those files + dangling links).
In System Settings/File associations "Microsoft Help Attribute Definition File" is a description for "application/octet-stream" type(see octet-stream.xml below).
It seems that they use it like some sort of fallback or default entry, because when I enter directory all of the files(not directories) for a few moments have this type(non-recognized?). Problem is specific to those file browsers, I installed Thunar, Tux Commander, Double Commander and they work fine. Files itself are okay:
[ ~]$ file .xsession-errors .xsession-errors: UTF-8 Unicode text, with very long lines, with CRLF, LF line terminators, with escape sequences [ ~]$ file --mime-type .xsession-errors .xsession-errors: text/plain [ ~]$ file link link: broken symbolic link to 43399594
Tried to spot this type files, found some in ~/.local/share/mime/ but any changes(with subsequent update-desktop-database update-mime-database calls and even reboot) gave nothing.
Thought that it may be due to wine office 2010 installation so erased wine mime, desktop and so files(link limit, you may find it on wine FAQ page under "4.3. How do I clean the Open With List?") to no avail. Then deleted wine prefix - same result. Wasn't able to find anything with google either (most of the problems there related to wrong application starting and not file type recognition).
Tested on a new user - all work like a charm. From there my .xsession-errors have type "unknown"
According to bug 337708 seems that it related to shared-mime-info. Didn't find anything specific.
octet-stream.xml <?xml version="1.0" encoding="utf-8"?> <mime-type xmlns="http://www.freedesktop.org/standards/shared-mime-info" type="application/octet-stream"> <!--Created automatically by update-mime-database. DO NOT EDIT!--> <comment>Microsoft Help Attribute Definition File</comment> <glob-deleteall/> <glob pattern="*.bin"/> <glob pattern="*.hxd"/> <glob pattern="*.hxh"/> <glob pattern="*.hxi"/> <glob pattern="*.hxq"/> <glob pattern="*.hxr"/> <glob pattern="*.hxs"/> <glob pattern="*.hxw"/> </mime-type>
[ ~]$ uname -a Linux Erefan 3.17.6-1-ARCH #1 SMP PREEMPT Sun Dec 7 23:43:32 UTC 2014 x86_64 GNU/Linux KDE [ ~]$ dolphin --version Qt: 4.8.6 KDE Development Platform: 4.14.3 Dolphin: 4.14.3
p.s. .xsession-errors used just as an example, actually many files have that wrong type.
Edit 1: After additional testing on new user I concluded that it is related to wine office 2010 installation. Specifically this installation put new octet-stream.xml file in ~/.local/share/mime/application/ which overrides the original one in /usr/share/mime/application/ . Actually installation provide application-octet-stream.xml in packages folder which is then used by update-mime-database to generate octet-stream.xml. Original file actually define "unknown" type of file. I'm not very familiar with syntax but it looks like there is nothing special. So I manually modified the application-octet-stream.xml to comply with the original + added icon(see below). So far all work just fine.
So if you want to try steps are as follows:
Check all by yourself in case anything happens you'll be the one to blame.
1. modify ~/.local/share/mime/packages/application-octet-stream.xml (see below). 2. run "update-mime-database ~/.local/share/mime/". 3. probably restart current session.
<?xml version="1.0" encoding="UTF-8"?> <mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info"> <mime-type type="application/octet-stream"> <comment>unknown</comment> <icon name="unknown"/> <glob pattern="*.hxd"/> <glob pattern="*.hxh"/> <glob pattern="*.hxi"/> <glob pattern="*.hxq"/> <glob pattern="*.hxr"/> <glob pattern="*.hxs"/> <glob pattern="*.hxw"/> </mime-type> </mime-info>
Next step - xml files have ugly windows icon(seems that office installation is the one to blame ) and I wonder why it doesn't change through normal File Associations settings.