LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
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 07-14-2004, 10:45 AM   #1
ashusharma
LQ Newbie
 
Registered: Dec 2003
Distribution: Redhat Linux 8.0
Posts: 17

Rep: Reputation: 0
Finding what the current desktop is


Hi,

Is there a consistent/robust way of finding progammatically (or via a shell script) what desktop one is running - Gnome/KDE/etc?

Thanks in advance,
Ashutosh
 
Old 07-14-2004, 10:54 AM   #2
Bruce Hill
HCL Maintainer
 
Registered: Jun 2003
Location: Tupelo, MS
Distribution: Gentoo
Posts: 6,926

Rep: Reputation: 124Reputation: 124
What distribution are you running? Try going to a term and running "xwmconfig"
 
Old 07-14-2004, 11:37 AM   #3
ashusharma
LQ Newbie
 
Registered: Dec 2003
Distribution: Redhat Linux 8.0
Posts: 17

Original Poster
Rep: Reputation: 0
Basically, I am trying to write a program that would use the default browser and email client on a users linux system, without having the user to specify these in my program's preferences. So, the program (or its installer) needs to have a way to find what the current desktop is, so that some appropriate way (specific to the desktop) can be used to find these default applications.
 
Old 07-14-2004, 11:38 AM   #4
ashusharma
LQ Newbie
 
Registered: Dec 2003
Distribution: Redhat Linux 8.0
Posts: 17

Original Poster
Rep: Reputation: 0
I'm sorry, but xwmconfig was not found on the system. I'm running Redhat 8.0.
 
Old 07-14-2004, 11:40 AM   #5
Bruce Hill
HCL Maintainer
 
Registered: Jun 2003
Location: Tupelo, MS
Distribution: Gentoo
Posts: 6,926

Rep: Reputation: 124Reputation: 124
You should edit your User CP and add your distribution so that those
trying to help you at least know what you're running.
 
Old 07-14-2004, 12:41 PM   #6
ashusharma
LQ Newbie
 
Registered: Dec 2003
Distribution: Redhat Linux 8.0
Posts: 17

Original Poster
Rep: Reputation: 0
Done.
Basically, the problem is to find programmatically (or through a shell script) what system the progme gets run on after I give it to some one.
 
Old 07-14-2004, 07:27 PM   #7
Bruce Hill
HCL Maintainer
 
Registered: Jun 2003
Location: Tupelo, MS
Distribution: Gentoo
Posts: 6,926

Rep: Reputation: 124Reputation: 124
You should post back how you did that so someone searching who
finds this thread can learn from your experience. That's how a communal
forum works.
 
Old 07-15-2004, 04:19 AM   #8
XavierP
Moderator
 
Registered: Nov 2002
Location: Kent, England
Distribution: Lubuntu
Posts: 19,176
Blog Entries: 4

Rep: Reputation: 430Reputation: 430Reputation: 430Reputation: 430Reputation: 430
ashusharma - I don't think your program will need to know what the default browser, etc is. If your program opens an html page, it will tell the system what it wants to do, the system will see that it can handle the request, it will check to see what program it uses to do this and will open it.

Chinaman - I think the "Done" was to say that Ashusharma had amended the distro entry in the side panel.
 
Old 07-15-2004, 10:01 AM   #9
keefaz
Senior Member
 
Registered: Mar 2004
Distribution: Slackware
Posts: 4,617

Rep: Reputation: 136Reputation: 136
You can use some test like :

Code:
#!/bin/bash

BROWSERLIST="mozilla konqueror galeon opera netscape"
BROWSER=

for i in $BROWSERLIST; do
    if which $i 1> /dev/null 2> /dev/null; then
        BROWSER=$(which $i)
        break
    fi
done

if [ -z "$BROWSER" ]; then
    echo "No known browser was found"
else
    echo "Found a workable browser : $BROWSER"
fi
 
  


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
Finding best way to hook up Linux laptop to WinXP desktop spywaremagnet Linux - Networking 3 07-30-2005 02:44 PM
finding out the current codec in Mplayer? Kilahchris Linux - Software 2 05-04-2004 02:53 PM
Finding information about the current shell atirya_yodha Linux - Newbie 3 03-18-2004 02:30 PM
finding current kernel config? reetep Linux - Newbie 2 12-31-2003 06:43 AM
Finding current load on the system kbeaver Linux - Newbie 2 09-04-2003 11:41 PM


All times are GMT -5. The time now is 05:33 AM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration