LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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 05-04-2009, 10:54 PM   #1
nil_fergi
LQ Newbie
 
Registered: May 2009
Posts: 12

Rep: Reputation: 0
How to get default browser name and mail client name by programmatically?


Hi,

I am developing a application in which i have to show the name of default browser and mail client.

i want to run this application on RedHat, SuSE, Mandriva, and Ubuntu.

I have checked similar threads but not found any useful information.

Any help / link / sample code/ guess appreciated.
Thanks in advance!!!
 
Old 05-05-2009, 06:15 AM   #2
aspire1
Member
 
Registered: Dec 2008
Distribution: Ubuntu
Posts: 62

Rep: Reputation: 23
I only know how to get it under the Gnome desktop.

for email:
gconftool-2 --get '/desktop/gnome/url-handlers/mailto/command'

and internet:
gconftool-2 --get '/desktop/gnome/url-handlers/http/command'
 
Old 05-05-2009, 09:31 AM   #3
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
The concept of 'default applications' is a part of other applications and desktops. How it is stored and configured within the domain of those applications is at best a documented API supported by each of those applications. You will not find any global or general defaults, and this explains why you haven't been able to find any such information.
--- rod.
 
Old 05-06-2009, 08:35 AM   #4
nil_fergi
LQ Newbie
 
Registered: May 2009
Posts: 12

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by aspire1 View Post
I only know how to get it under the Gnome desktop.

for email:
gconftool-2 --get '/desktop/gnome/url-handlers/mailto/command'

and internet:
gconftool-2 --get '/desktop/gnome/url-handlers/http/command'
Does gconftool will be available on older versions (like RedHat 7 and below or below SuSE 7.3) also??

Last edited by nil_fergi; 05-06-2009 at 08:37 AM.
 
Old 05-06-2009, 08:49 AM   #5
nil_fergi
LQ Newbie
 
Registered: May 2009
Posts: 12

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by theNbomr View Post
The concept of 'default applications' is a part of other applications and desktops. How it is stored and configured within the domain of those applications is at best a documented API supported by each of those applications. You will not find any global or general defaults, and this explains why you haven't been able to find any such information.
--- rod.
Hi thanks for reply.

I didn't understand completely but if i create a test.htm and tried to double click on it, how Linux decide to open the (which firefox or opera??) browser.
I think there should be a configuration file for the same.

I found a command 'mailsetting'on fedora 9 gives me a mailclient name.
but its not available on some below versions.
 
Old 05-06-2009, 10:06 AM   #6
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
Quote:
I didn't understand completely but if i create a test.htm and tried to double click on it, how Linux decide to open the (which firefox or opera??) browser.
I think there should be a configuration file for the same.
Your misunderstanding is what I tried to say in my earlier post. The concept of 'default applications' is not a Linux-wide concept, but is limited to some other application. When you say 'tried to double click on it', this means nothing at the Linux core level. 'Double-clicking' implies that there are any number of layers which may play a part in launching other applications. There are two major desktop managers, KDE & Gnome, and a long list of less popular ones as well as simpler window managers. Each of these may have, and probably do have, their own mechanism for selecting and launching default applications. In addition to this, individual applications will often have their own concept of default helper applications, and the mechanism for configuring and accessing each of these will differ according to the application.

It would probably be nice if there was some global mechanism that was common to all applications and desktop managers, but I don't think any such thing exists at present.
--- rod.
 
Old 05-06-2009, 11:40 AM   #7
amysaraantony
Member
 
Registered: Apr 2009
Posts: 42

Rep: Reputation: 16
Quote:
Originally Posted by theNbomr View Post
Your misunderstanding is what I tried to say in my earlier post. The concept of 'default applications' is not a Linux-wide concept, but is limited to some other application. When you say 'tried to double click on it', this means nothing at the Linux core level. 'Double-clicking' implies that there are any number of layers which may play a part in launching other applications. There are two major desktop managers, KDE & Gnome, and a long list of less popular ones as well as simpler window managers. Each of these may have, and probably do have, their own mechanism for selecting and launching default applications. In addition to this, individual applications will often have their own concept of default helper applications, and the mechanism for configuring and accessing each of these will differ according to the application.

It would probably be nice if there was some global mechanism that was common to all applications and desktop managers, but I don't think any such thing exists at present.
--- rod.

Even these Window Managers need to store the relationship between the file file type and the application used to open it somewhere.
Any idea where that file would be for KDE and Gnome Window Managers?

Debian

Last edited by amysaraantony; 05-15-2009 at 08:12 PM.
 
Old 05-06-2009, 12:58 PM   #8
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
I can only guess, but I doubt that it is a file. Probably something accessed through dcop for KDE. I think Gnome has some similar messaging scheme.
--- rod.
 
Old 05-07-2009, 09:44 PM   #9
nil_fergi
LQ Newbie
 
Registered: May 2009
Posts: 12

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by theNbomr View Post
Your misunderstanding is what I tried to say in my earlier post. The concept of 'default applications' is not a Linux-wide concept, but is limited to some other application. When you say 'tried to double click on it', this means nothing at the Linux core level. 'Double-clicking' implies that there are any number of layers which may play a part in launching other applications. There are two major desktop managers, KDE & Gnome, and a long list of less popular ones as well as simpler window managers. Each of these may have, and probably do have, their own mechanism for selecting and launching default applications. In addition to this, individual applications will often have their own concept of default helper applications, and the mechanism for configuring and accessing each of these will differ according to the application.

It would probably be nice if there was some global mechanism that was common to all applications and desktop managers, but I don't think any such thing exists at present.
--- rod.
Hi Very nice explanation. Thanks
now i got the details, i was thinking like the Windows OS but the complete difference is there.
Now i did conclusion that there is not any possible solution to my problem.

Thanks.
 
  


Reply



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
Setting the default browser for Ximian Evolution mail client. sepulture Linux - Software 2 11-21-2005 10:03 PM
setting default mail browser and email client novacrasher Linux - General 9 01-12-2005 02:31 PM
Default browser & E-mail Client sudhasmyle General 1 11-26-2004 10:16 AM
Finding default browser and mail client ashusharma Linux - Software 4 07-15-2004 12:25 AM
How to start up a default internet browser programmatically? kin Programming 0 09-12-2001 06:46 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:53 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration