-   Programming (
-   -   Finding what the current desktop is (

ashusharma 07-14-2004 09:45 AM

Finding what the current desktop is

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,

Bruce Hill 07-14-2004 09:54 AM

What distribution are you running? Try going to a term and running "xwmconfig"

ashusharma 07-14-2004 10:37 AM

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.

ashusharma 07-14-2004 10:38 AM

I'm sorry, but xwmconfig was not found on the system. I'm running Redhat 8.0.

Bruce Hill 07-14-2004 10:40 AM

You should edit your User CP and add your distribution so that those
trying to help you at least know what you're running.

ashusharma 07-14-2004 11:41 AM

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.

Bruce Hill 07-14-2004 06:27 PM

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.

XavierP 07-15-2004 03:19 AM

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. :)

keefaz 07-15-2004 09:01 AM

You can use some test like :



BROWSERLIST="mozilla konqueror galeon opera netscape"

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

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

All times are GMT -5. The time now is 03:28 PM.