You are not logged in.

#1 2008-12-03 14:32:20

awagner
Member
From: Mainz, Germany
Registered: 2007-08-24
Posts: 191

docx and mime type (thunar)

Hi all,
while I know that openoffice can open those freakin' docx files, I would like to be able to open them by just clicking on them in thunar. However, it seems that thunar recognises them as files of type "zip archive". Of course, I want to associate OOo by default to them, but not to zip archives in general. Does anyone have an idea where I would have to intervene?

TIA,
Andreas

Offline

#2 2008-12-18 14:28:35

Cheesebaron
Member
From: Denmark
Registered: 2008-10-31
Posts: 65
Website

Re: docx and mime type (thunar)

I seem to have the same problem as you just with pdf and xoj files. It is really annoying, every time i set it by rightclicking and choosing what application has to open it, and then restart my computer the settings vanish.

Offline

#3 2008-12-18 14:33:03

kjon
Member
From: Temuco, Chile
Registered: 2008-04-16
Posts: 398

Re: docx and mime type (thunar)

i had the same trouble. I wiped my mime-config from my home and problem solved. (But I had to set by hand some associations).


They say that if you play a Win cd backward you hear satanic messages. That's nothing! 'cause if you play it forwards, it installs windows.

Offline

#4 2008-12-18 14:36:49

Cheesebaron
Member
From: Denmark
Registered: 2008-10-31
Posts: 65
Website

Re: docx and mime type (thunar)

Where is this file you talk about?

Offline

#5 2008-12-18 18:17:39

kjon
Member
From: Temuco, Chile
Registered: 2008-04-16
Posts: 398

Re: docx and mime type (thunar)

delete .local/share/mime directory.

Sorry about it, I forgot completly to post the path ^^!


They say that if you play a Win cd backward you hear satanic messages. That's nothing! 'cause if you play it forwards, it installs windows.

Offline

#6 2008-12-30 18:50:15

awagner
Member
From: Mainz, Germany
Registered: 2007-08-24
Posts: 191

Re: docx and mime type (thunar)

Sorry, I was referring to another issue. When dealing with openoffice's odt files, thunar recognizes them as files of (MIME, I suppose) type "ODT File". I set thunar to always open with openoffice and that's it. I want to do the same for Microsoft's *.docx files, but they're recognized by thunar as "zip archive" type files. Now how can I have openoffice open one part of "zip archive" files (namely, those that end in *.docx) and the other part (ending in *.zip) with xarchiver?

Offline

#7 2008-12-31 00:28:06

kjon
Member
From: Temuco, Chile
Registered: 2008-04-16
Posts: 398

Re: docx and mime type (thunar)

dunno that...


They say that if you play a Win cd backward you hear satanic messages. That's nothing! 'cause if you play it forwards, it installs windows.

Offline

#8 2009-05-10 12:40:04

senjin
Member
Registered: 2006-09-15
Posts: 181
Website

Re: docx and mime type (thunar)

I have a similar (I guess) problem. Thunar recognizes .doc files as a plain text file and tries to open it with kwrite. Of course I don't want to to assign openoffice to all plain text files. After reading this thread I deleted my .local/share/mime, it helped for a while, but now the problem is back again.

Offline

#9 2009-05-10 12:54:58

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,365
Website

Re: docx and mime type (thunar)

Right click > Open with Other Application > Pick something and click on the make default box.

Offline

#10 2009-05-10 13:09:49

senjin
Member
Registered: 2006-09-15
Posts: 181
Website

Re: docx and mime type (thunar)

This causes all plain text files to be open with openoffice, which is obviously not what I want. sad

Offline

#11 2009-05-11 07:55:25

awagner
Member
From: Mainz, Germany
Registered: 2007-08-24
Posts: 191

Re: docx and mime type (thunar)

I had a try with

mimetype -aD somedocfile.doc

and that pointed me to a line

text/plain:*.doc

in both /usr/share/mime/globs and /usr/share/mime/globs2. I commented that out and now at least the mimetype command identifies the file in question as application/msword. thunar still opens it with leafpad, but I suppose that was a good first step.

Offline

#12 2009-05-11 20:33:53

senjin
Member
Registered: 2006-09-15
Posts: 181
Website

Re: docx and mime type (thunar)

Thanks for the clue! I think I found the right solution.

The 'mimetype' command doesn't work for me. However I looked at the /usr/share/mime/globs and /usr/share/mime/globs2 files. They indeed contained 'text/plain:*.doc'. However at the beginning of these files there is an information that these files are generated automatically by 'update-mime-database' and should not be modified.

I found an information that update-mime-database reads the files in /usr/share/mime/packages. There it is! kde.xml contains lines:

  <mime-type type="text/plain"> <!-- As discussed on xdg list, *.doc is needed here for disambiguation -->
    <glob pattern="*.asc"/>
    <glob pattern="*.txt"/>
    <glob pattern="*.doc"/>
  </mime-type>

Well... I don't see a good reason to keep the *.doc there. I removed the line and run

update-mime-database /usr/share/mime

restarted xfce and now it seems to work fine. So I think this is an upstream bug in kdelibs.

Offline

#13 2009-05-21 02:27:36

stryder
Member
Registered: 2009-02-28
Posts: 500

Re: docx and mime type (thunar)

Senjin, thanks. The issue of being able to control mimetypes so as to get the proper icon in thunar has been bothering me for a while. Your solution has pointed me in the right direction. In this case, clearly the kde people know it causes a problem:

<!-- As discussed on xdg list, *.doc is needed here for disambiguation -->

yet have gone ahead tagging .doc as text/plain for "disambiguation", whatever that means. I just wonder if we are getting to a situation where developers are making decisions for users for reasons that are unrelated to the real world...

Offline

#14 2009-05-21 05:07:37

awagner
Member
From: Mainz, Germany
Registered: 2007-08-24
Posts: 191

Re: docx and mime type (thunar)

Just for the records, I think what is meant by disambiguation (I've read in the xdg archives, but I don't have the url anymore) is this:
There are *.doc files that are not MS Word but indeed plaintext files (e.g. /usr/share/kbd/keymaps/i386/qwerty/no-latin1.doc, /usr/lib/python2.6/pdb.doc). So the idea was - AFAIU - to associate the glob '*.doc' with textfiles and to have some "magic" recognise MS-Word-specific strings only inside Word files and in those cases overrule the plaintext association with the application/msword association. Maybe the word files I have have a different string in them, which leads to them being associated with plaintext only, but I suppose that would be the end from which to tackle this properly (bugreport to xdg etc.) ... if only I cared about the non-msword doc files. But since I don't, I have followed senjin's route - thanks from me, too. smile

Offline

#15 2009-06-14 06:37:38

MartinZ
Member
From: Chiloé, Chile
Registered: 2005-06-10
Posts: 379

Re: docx and mime type (thunar)

Thanks a lot senjin, I could by no way find the solution.


All your base are belong to us

Offline

#16 2009-06-14 09:02:54

senjin
Member
Registered: 2006-09-15
Posts: 181
Website

Re: docx and mime type (thunar)

Well... that's rather a hack than a solution. I think it might be because xfce and kde treats the mime types different way...

Offline

#17 2009-10-02 14:27:43

ixzus
Member
From: Barcelona (Spain)-Bristol (UK)
Registered: 2008-10-25
Posts: 26

Re: docx and mime type (thunar)

Thank you so much senjin, nice hack!
I was getting very frustrated with this


"If at first an idea is not absurd, then there is no hope for it."  A. Einstein

Offline

#18 2009-10-02 14:39:42

senjin
Member
Registered: 2006-09-15
Posts: 181
Website

Re: docx and mime type (thunar)

Unfortunately you need to repeat the trick each time you update kde sad or prevent pacman from updating the problematic files.

Offline

Board footer

Powered by FluxBB