LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 04-08-2004, 09:15 PM   #1
vi0lat0r
Member
 
Registered: Aug 2003
Location: Lewisville, TX
Distribution: Kubuntu
Posts: 295

Rep: Reputation: 30
bash script to set extension association


What is the code that will set the extension (say .html) to use (say Mozilla) instead of the default (say Konqueror)? I would like to put that script in my .bash_profile script so I wouldn't have to change it back everytime I login :-)

Thanks!
 
Old 04-08-2004, 10:26 PM   #2
paulsm4
Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Hi -

What program gets activated when you click on a file has nothing to do with your shell (e.g. "bash") and everything to do with your desktop GUI and your choice of "File Explorer" tool.

For example, I have a KDE desktop and use "Konqueror" as both my web browser and File Explorer. I can change file mappings from inside of Konqueror. When I do so, it invokes the executable "/usr/bin/keditfiletype", which in turn updates the MIME types on my machine. This may or may not be what you want to do.

You can find more information here:

http://docs.kde.org/en/HEAD/kdevelop...ents-mime.html

'Hope that helps .. PSM
 
Old 04-09-2004, 03:16 PM   #3
vi0lat0r
Member
 
Registered: Aug 2003
Location: Lewisville, TX
Distribution: Kubuntu
Posts: 295

Original Poster
Rep: Reputation: 30
Ok that isn't what I was talking about.

When Kopete says I have a new email, I click on it then it opens Konqueror and loads my email inbox. I have to change the default application from Konqueror everytime I login to Mozilla Firefox, and I just wanted to know what the command to do that is, so I can add it to .bash_profile.

Meaning, login, click the new email thing from Kopete, Mozilla Firefox loads my inbox instead of Konqueror (without having to go in and change the default application manually).

So anyone know the command?
 
Old 04-10-2004, 01:39 PM   #4
vi0lat0r
Member
 
Registered: Aug 2003
Location: Lewisville, TX
Distribution: Kubuntu
Posts: 295

Original Poster
Rep: Reputation: 30
Anyone at all?
 
Old 04-10-2004, 02:37 PM   #5
paulsm4
Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Your original question was quite vague with respect to:
a) What you were trying to do
b) What you hoped to accomplish

I'm inferring from your subsequent responses that the actual problem is this:

1) You're using Kopete from your desktop

2) You're unhappy with the file associations Kopete is giving you:

When you double-click on something with an .html suffix, you'd prefer
to get "Mozilla" instead of "Konqueror" (for example).

I'm not familiar with Kopete, and I certainly don't know how Kopete manages "file associations". For example, "File Explorer" under Windows lets you manage "file types" directly from the File Explorer GUI (specifically, "Tools, Folder Options, File types"), but the actual associations are stored on a system-wide basis in the Windows registry. As another example, Konqueror also supports "file associations", and also lets you manage these associations from the Konqueror GUI - but it uses the Apache-level "MIME types" mappings (see the URL I forwarded you yesterday for more details).

Under no circumstances can you easily set some environment variable to change these mappings - I think it's extremely unlikely you'll find some "magic command" to insert into your .bash_profile.

Instead, I'd strongly suggest going back and looking closer at "Kopete" and working your way backwards from there.

Good luck - and please let us know what you find!
 
Old 05-02-2004, 11:24 PM   #6
Eskarel
LQ Newbie
 
Registered: Apr 2004
Posts: 8

Rep: Reputation: 0
I haven't quite solved this yet myself, but as far as I can tell, the key to this is changing the file association for kde. Kopete is a part of kde and as such it tends to use kde associations.
 
Old 05-24-2004, 07:04 PM   #7
Rico16135
Member
 
Registered: Aug 2003
Location: Texas, USA
Distribution: Slackware 9.1, SuSE 9.1
Posts: 245

Rep: Reputation: 30
To get Kopete to use Firefox you have to go to the kde control panel -> kde-components -> file associations -> text -> html and move Firefox above Konqueror.

Of course this solution is system-wide, but if you're trying to use Firefox in Kopete, you probably want it that way system-wide. I don't believe however that the writer's of Kopete gave Kopete the option of what browser to bring up. It is a kde project, so they probably relied on KDE's file-extension gui within the control panel.
 
  


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
bash script to sort files by extension otheralex Programming 7 08-19-2005 02:40 AM
set and export using bash script acummings Linux - General 10 01-03-2005 02:22 PM
distro extension script DAChristen29 Linux - General 4 01-13-2004 08:57 AM
Perl script association mijohnst Linux - Software 2 11-25-2003 08:51 AM
bash scripting - largest # file extension brian0918 Programming 3 06-16-2003 12:06 PM


All times are GMT -5. The time now is 02:16 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