LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 03-18-2002, 10:57 AM   #1
Calum
Member
 
Registered: Mar 2002
Location: London
Distribution: Red Hat 9
Posts: 302

Rep: Reputation: 30
"Open With..." File Type Association???


question!

How would i associate a particular type of file (say .pdf or .mov) with a particular application, both in GNOME and in KDE (or is there some Config file i can edit? if so how?)?

In windows you can right click, select "Open With..." (you can also do this in KDE and GNOME) but in KDE and GNOME, there is no option to set the default application for that file type, like there is in windows. How do i set this please?

I have been reading the man pages and the red hat 7.0 (the version i have) getting started book , and cannot find any answer whatsoever!

Please help i am stumped!
thanks!
 
Old 03-18-2002, 11:19 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,414

Rep: Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967
in gnomecc there is a file types section in the Document Handlers section.
 
Old 03-18-2002, 11:49 AM   #3
Calum
Member
 
Registered: Mar 2002
Location: London
Distribution: Red Hat 9
Posts: 302

Original Poster
Rep: Reputation: 30
where is that exactly?

somebody gave me a similar answer in another forum regarding KDE, but i have looked through the control centers of both GNOME and KDE and i can't find anything that resembles that option!

i know i am missing something obvious so maybe you could walk me step by step towards where i might find that particular thing there please?

and if anybody can explain in idiot language the same thing for KDE i would be most grateful!

ta a lot, folks!
 
Old 03-19-2002, 01:05 AM   #4
isajera
Senior Member
 
Registered: Jun 2001
Location: San Antonio, TX
Distribution: distro? what's a distro?
Posts: 1,635

Rep: Reputation: 45
in gnome, you open the control center - go to Document Handlers. under Document Handlers, there's a "File Types and Programs" section. there's a list of file extensions and associated actions that go with the file type. it's called mime types - you can edit them in that section.
 
Old 03-19-2002, 05:55 AM   #5
Calum
Member
 
Registered: Mar 2002
Location: London
Distribution: Red Hat 9
Posts: 302

Original Poster
Rep: Reputation: 30
oh yes, those mime types...

well, i have been in there a few times, but to no avail.
What i do is i open up the mime types thing, and select the file type i want to fiddle with, let's say it's "application/pdf", then i click the edit button, which takes me to a little thing where i can specify the read, write, and execute command string for that type of file. Okay, so far so good.
I note that i am given "emacs %f" as an example and reason that the " %f" must be the part of the string that gets substituted for the filename...
Right, so i have got all three boxes (read, write and execute) set to "xpdf %f", i have also tried just "xpdf". Of course i only want to read pdfs right now so the other two boxes are irrelevant.

Now, looks okay, i click okay to save the settings, then exit the control center.
doubleclick on a pdf file (it still doesn't come up with a pdf logo, bad sign) and i get asked which app i want to use. No good, i just specified it in the control center, so why's it still asking?
I reason that perhaps i have to log out of X for the changes to take effect (why i wouldn't know...) so i reboot to be on the safe side. Try doubleclicking the file again, no joy, i still get asked. I look in the control center to check the settings, and yes they still say "xpdf %f" just like before, so my settings *have* been saved, they just *don't work*!

Oh please, if you know the answer, please help! thanks to the two guys who answered me already btw! maybe my syntax is wrong...?

Also, what about KDE?
thanks...
 
Old 03-19-2002, 11:02 AM   #6
Calum
Member
 
Registered: Mar 2002
Location: London
Distribution: Red Hat 9
Posts: 302

Original Poster
Rep: Reputation: 30
I have done a bit of searching regarding mime types, it seems that a few people have had this problem, so i thought i'd post my results in case they are of any help to anybody else. Of course, if you are a person who can add more to this topic, please do, i will be happy to read what you say! myself, i am just guddling in the dark with this subject!

Firstly, here's this stuff that i found on mail.gnome.org
Quote:
> On Wed, 6 Dec 2000, Minson, John M. [Contractor] wrote:
>
> > All my attempts to change the mime association of a <something>.mpeg file
> > to 'gtv' fail.
> > The 'edit mime types' operation seems to work and shows 'gtv' in both the
> > open and view fields of the Mime Type Actions . When I open a 'mpeg' it
> > insists on running 'xanim' .
> > Is there some system wide default overriding my personnel settings ?
----------------------------------
Ralph Slooten wrote:
> I have the same problem with MTV. Each time I get an error that xamin can't
> be opened. Only when I right-mouse-click on the MPG and select view doe it
> work.
>
----------------------------------
> I don't know why the mime-types capplet insists on screwing this up.
> Take a look at the ~/.gnome/mime-info/user.keys file. If you see
> "[(null)]" anywhere then remove it. My user-keys file looks like:
>
> video/mpeg:
> open=mtvp -l %f
> view=mtvp -l %f
>
> If I use the control panel capplet to edit any mime types, what my
> user-keys file turns into is:
>
> video/mpeg:
> [(null)]open=mtvp -l %f
> [(null)]view=mtvp -l %f
>
> I don't have any idea what those [(null)]s are supposed to be for, but
> get rid of them and everything will work as you expect.
-------------------------------------
Håvard wrote:
The (null)s are the current locale, which Gmc insists on adding. I've yet
to get MIME-types to work without hand editing. Håvard
-------------------------------------
On Thu, 7 Dec 2000, Ralph Slooten wrote:
> Well, in the beginning when I edited it it didn't work, yet now it works
perfectly :-)
> Just strange that it didn't work for MPG! The rest worked fine, just not
> that one?!?!
>
I haven't tried it yet, but will tonight or tomorrow...
also, in KDE, from the KDE User Manual:
Quote:
5.1.1. Opening Files
KDE comes with a set of applications to view and edit many common kinds of files, and when you click a file containing, say, a document or image, Konqueror will start the appropriate application to display the file. If it doesn't know what application to start to open a file
you clicked, Konqueror will prompt you for the name of the application to run.

Konqueror uses MIME types to associate files with applications...

5.1.3. Setting File Properties
To change file properties, such as its name and permissions, right-click the icon and choose Properties from the menu.

KDE comes with a number of MIME types predefined, but you can add your own MIME types by choosing Settings-&gt;Configure-&gt;File Associations in a Konqueror window.
Again, haven't tried it yet, but thought i'd post it in case it was useful to somebody else.
If it doesn't work, i'll be back, screaming and shouting about it, no doubt...

Last edited by Calum; 03-19-2002 at 11:07 AM.
 
Old 03-19-2002, 11:11 AM   #7
Sixpax
Member
 
Registered: Mar 2002
Distribution: Mandrake 8.1
Posts: 386

Rep: Reputation: 30
This is pretty simple under KDE... just go to the control center, expand "File Browsing", and click on "File Associations".
 
Old 03-20-2002, 10:22 AM   #8
Calum
Member
 
Registered: Mar 2002
Location: London
Distribution: Red Hat 9
Posts: 302

Original Poster
Rep: Reputation: 30
i can't find it there, maybe it's moving around because it knows i;m looking for it...

I have had 3 or 4 people tell me how to do the file type thing in KDE, and no two have been the same, not only that, none work on my computer! i may be missing something because the one thing everybody says is that it's really easy!

Right, as far as the GNOME file types problem was concerned, i went and did all that stuff from my last post and *no change*!
well, it turns out that what i had to do was this:
right click on the GNOME/Sawfish desktop, and DEselect the "detect file types by their mime types rather than their extension" box, and it all works fine now!
Just thought i'd post this, as i say, for posterity...
 
Old 09-30-2004, 01:34 PM   #9
Nightfrost
Member
 
Registered: Jun 2004
Location: Sweden
Distribution: ArchLinux
Posts: 201

Rep: Reputation: 30
...and in KDE?

Does anyone know how to do the above (i.e. turn off mime and enable recognition by extension) in KDE?
I can't find any solution to this seemingly easy problem anywhere. Thanks.
 
Old 12-07-2004, 10:03 AM   #10
GinEric
Member
 
Registered: Nov 2004
Location: Earth
Distribution: Slackware 10, et ux
Posts: 36

Rep: Reputation: 15
Nobody does it better, but Katy does it backwards!

Changing file associations in KDE is broken, period.

If you attempt to use the properties of a file and edit the file type, you will not edit the file type for that singular file, but for all files with that type embedded in their properties!

This is a fubar.

Why? Because if you delete, for example, the file associations and types or change the name of the file type, kde will change all files associated as that type.

For example, should you wish to change a file that shows up as cpp {C++ Sourec File} meaning only to change that particular file, say newproggie.c.my kde will go and change every cpp files association on your system, and delete all of the associations, types, and description. So now all of your previous cpp files will show up as the new type and will no longer look pretty and open in kwrite with multicolors as they did before.

.h files, headers files, are similarly associated so you might think if kde fubar'ed cpp you can fix it quickly by making cpp similar to .h Not so.

kde conventions and developers need to add both a warning about changing the file associations, and, more importantly, make changing the file association work on only the particular file you want to change.

What all of this means is that you can't create a new file association. I hate to say that a little could be learned from Windows, but in this case it's true. If you create a file with Kwrite, it remains a Kwrite file no matter what you think you've changed it to. Adding a new extension and trying to edit the file association will only change all of the Kwrite file associations on your system.

Maybe kde needs a "create file type" set.
 
Old 01-28-2005, 05:43 PM   #11
GinEric
Member
 
Registered: Nov 2004
Location: Earth
Distribution: Slackware 10, et ux
Posts: 36

Rep: Reputation: 15
No answers yet because no one knows how KDE is broke, along with all programs that depend on file type associations in Linux.

KDE and KWrite, or any attempt to associate a file with an extension, takes the file descriptor and not the association and changes all files of that genre on the entire Linux Operating System.

Neither KDE nor KWrite, not any program should have permission to do this.

For example, when you do get to File Associations and select the tree for Text, then select a file type, such as one I've created called x-zone, based on plain text, create the endings and the application preference orderand then click on the icon button, if you dare change the icon, all files of the previous icon button, i.e., plain text, will be changed for every file on the system!

The file type is selected by the Description, and all files of that description will be changed!

This is totally backwards.

You only wanted to change the association so that a new ending would be affected, but that is not how KDE works. Rather, it works on the Description and changes all files of that Description!

It is really a bad attempt at file association on the developers' part, in that it associates the Description and the changes you apply, and not the file ending. It can royally screw up a file system.

Creating a new type is difficult as well because if you don't have a file to associate [created already], you can't associate it. So the Description comes from a file whose association you want to change, however, this causes KDE to change all files and apparently totally disregard the ending you have supplied.

The Howto on mime types, and creating one, leave out one crucial element: how to make KDE or KWrite install and use the new mime type and show it in the drop down menus.

All in all, it's developing too fast without paying attention to what is going on.

And widgets, like File Association, are consequently broke because of this approach.
 
  


Reply


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
kino gives "invalid file specified" when i try to open an *.mpg file lefty.crupps Linux - Software 1 10-31-2005 04:20 AM
Can you explain the difference between "Free Software (GNU)" and "Open Source"? vharishankar General 5 03-03-2005 10:40 AM
"X-MS" cant open because "x-Multimedia System" cant access files at "smb&qu ponchy5 Linux - Networking 0 03-30-2004 12:18 AM
Debian kernels: "warning: can't open /etc/mtab: No such file or directory" brurien Debian 1 10-22-2003 07:09 PM
<input type="button" disabled="true" > does not work in ns4.7 or 4.9 cybercop12us Programming 2 11-29-2002 09:31 AM


All times are GMT -5. The time now is 07:14 AM.

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