LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices

Reply
 
Search this Thread
Old 12-13-2009, 03:52 PM   #1
darenw
Member
 
Registered: Mar 2009
Location: Very humid Central Florida
Distribution: ArchLinux
Posts: 30

Rep: Reputation: 1
Thunar has welded .doc and .txt file types together!


Thunar file manager opens .txt and .doc with a plain text editor. But .doc files look like gibberish; Open Office Writer should be the prefered app for these. When I tell Thunar to use OO Writer for .doc, the .txt files also now open with OO Writer. Whichever app I assign to the one file type, the other gets too. How to break this unwanted short-circuit of file types?

BTW, I like Thunar for its lightweight, clean simplicity, but use icewm not xcfe (xfce?) as my windows manager.

And of course, "it used to work right" some months ago. Don't bother asking what changed; it's lost in the mists of history.
 
Old 12-14-2009, 02:15 AM   #2
TheIndependentAquarius
Senior Member
 
Registered: Dec 2008
Posts: 4,619
Blog Entries: 29

Rep: Reputation: 896Reputation: 896Reputation: 896Reputation: 896Reputation: 896Reputation: 896Reputation: 896
Right click .txt document,
click: open with
click: open with other application...
click: gedit
click: use as default for this kind of application
(at bottom of the dialog box)

Try this and reply what happened after this ?

Last edited by TheIndependentAquarius; 12-14-2009 at 02:17 AM.
 
0 members found this post helpful.
Old 12-14-2009, 08:55 AM   #3
darenw
Member
 
Registered: Mar 2009
Location: Very humid Central Florida
Distribution: ArchLinux
Posts: 30

Original Poster
Rep: Reputation: 1
"Try this and reply what happened after this"

the .doc files now open also with gedit.

I want the .doc to be opened by default with OO Writer, and the .txt to open with the plain text editor (i actually use kwrite or scite most of the time).
 
Old 12-14-2009, 09:40 AM   #4
cola
Senior Member
 
Registered: Sep 2007
Location: Dhaka,Bangladesh
Distribution: Debian
Posts: 1,019

Rep: Reputation: 63
Quote:
Originally Posted by darenw View Post
"Try this and reply what happened after this"

the .doc files now open also with gedit.

I want the .doc to be opened by default with OO Writer, and the .txt to open with the plain text editor (i actually use kwrite or scite most of the time).
Right click the file>properties.
Do you find any option to change the open with option?
 
0 members found this post helpful.
Old 12-14-2009, 10:47 AM   #5
darenw
Member
 
Registered: Mar 2009
Location: Very humid Central Florida
Distribution: ArchLinux
Posts: 30

Original Poster
Rep: Reputation: 1
"Right click the file>properties...."

I can change the app there too, but same result. As if .txt and .doc are treated as only one file type.

I'm still not sure if this is a Thunar-related problem or something deeper in my Linux setup that may be affecting other apps too. Haven't come across any examples recently, but that doesn't mean much.
 
Old 12-14-2009, 11:56 AM   #6
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Servers: Debian Squeeze and Wheezy. Desktop: Slackware64 14.0. Netbook: Slackware 13.37
Posts: 8,528
Blog Entries: 27

Rep: Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176
What are the mime-types associated with the files? Thunar can be configured to display MIME Type via View->"Configure Columns". On my system, a sample .doc file is shown as application/msword while a sample .txt file is shown as text/plain.

The system identifies files as particular MIME types according to the definitions in files in places that very from distro to distro and desktop to desktop.

If this problem is affecting only one user, you could try (as the user) to find the user-specific mime configuration files by
Code:
find ~ \( -type f -o -type d \) -iname '*mime*'
If you find any you could try renaming them make them inaccessible and restarting your desktop session. If the problem disappears it was caused by one of the files in there.

If the problem does not disappear then it is probably caused by system-wide mime files which would require more careful investigation. You could try (as root) to find them by
Code:
find / \( -type f -o -type d \) -iname '*mime*'
The system identifies MIME types by several characteristics (I know only a little about this) including extensions, as defined by files in the mime/glob* directories, and by looking into the files looking for "magic numbers", characteristic strings ...
 
1 members found this post helpful.
Old 12-14-2009, 06:21 PM   #7
darenw
Member
 
Registered: Mar 2009
Location: Very humid Central Florida
Distribution: ArchLinux
Posts: 30

Original Poster
Rep: Reputation: 1
I have found /etc/mime.types but appears not to be used by thunar, at least not concerning .txt and .doc. The Thunar help mentions an environment var which hold the path to ~/.cache/, in which I find a Thunar directory. In that are some files which also turn out to have no relevance.

What the heck, how 'bout removing thunar (and some other apps and libs) and re-installing using the package manager for my distro? I'll be back with the results...
 
Old 12-14-2009, 09:29 PM   #8
darenw
Member
 
Registered: Mar 2009
Location: Very humid Central Florida
Distribution: ArchLinux
Posts: 30

Original Poster
Rep: Reputation: 1
Catkin's answer got me started on hunting for mime files. Finally solved the problem!

First, a false lead: while in Konqueror, ran KEditFileType from file properties. It listed .doc among files considered to be text/plain. Deleted it, but problem remained. Turns out the files KDE apps used were automatically regenerated, and the .doc extension was reinserted as a text/plain clue.

Found a bunch of files in /usr/share/mime, one .xml file per mime type. Editing /usr/share/mime/text/plain.xml to remove a glob line listing .doc did not solve the problem. Well sort of, but there was that file regeneration thing again...


SOLUTION:
This requires fixing a KDE file, even if you're not caring to run KDE.
Edit /usr/share/mime/packages/kde.xml
Comment out or remove the line <glob pattern="*.doc"/>
Run at a command line, as root:
update-mime-database /usr/share/mime
Now file properties for .doc and .txt look okay in Thunar.
 
Old 12-15-2009, 12:26 AM   #9
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Servers: Debian Squeeze and Wheezy. Desktop: Slackware64 14.0. Netbook: Slackware 13.37
Posts: 8,528
Blog Entries: 27

Rep: Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176
Quote:
Originally Posted by darenw View Post
SOLUTION:
This requires fixing a KDE file, even if you're not caring to run KDE.
Edit /usr/share/mime/packages/kde.xml
Comment out or remove the line <glob pattern="*.doc"/>
Run at a command line, as root:
update-mime-database /usr/share/mime
Now file properties for .doc and .txt look okay in Thunar.
Glad you sleuthed the solution and thanks for posting it. I figure developing an understanding of how the MIME system works will become progressively more important.
 
  


Reply

Tags
mime, thunar


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need to convert a large number of file types from none standard to txt metalme Linux - Newbie 2 09-28-2009 05:46 PM
Short-circuited file types - .doc, .txt stuck on same app darenw Linux - Software 0 03-27-2009 09:07 PM
.doc to .txt conversion vaalu Linux - Newbie 3 05-10-2008 12:46 PM
from html to txt/doc gawain Linux - Software 6 02-06-2007 01:58 AM
convert .doc to .txt using C++ ckamheng Programming 2 06-21-2003 08:25 AM


All times are GMT -5. The time now is 04:18 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration