[Gambas-user] An open question

Benoit Minisini gambas at ...1...
Tue Aug 1 01:58:21 CEST 2006


On Tuesday 01 August 2006 01:05, Benoit Minisini wrote:
> On Tuesday 01 August 2006 00:52, Pablo Vera wrote:
> > I am not sure if this is really reliable or which line could be the
> > best, but you could do a:
> >
> >    ps -A | grep kdeinit
> >
> > or
> >
> >    ps -A | grep kded
> >
> > or
> >
> >    ps -A | grep kdesktop
> >
> >
> > and if this return something, then KDE is running.
> >
> >
> > Pablo
>
> Not reliable. That means that somebody (or something) runs KDE, but I must
> be sure that my program is displayed on a KDE desktop. Don't forget that on
> X, you can put any network between the display and the process.
>
> Regards,

Hourah!

I found that in the source code of the Portland xdg-utils source code:

#--------------------------------------
# Checks for known desktop environments
# set variable DE to the desktop environments name, lowercase

detectDE()
{
    if [ x"$KDE_FULL_SESSION" = x"true" ]; then DE=kde;
    elif [ x"$GNOME_DESKTOP_SESSION_ID" != x"" ]; then DE=gnome;
    elif xprop -root _DT_SAVE_MODE | grep ' = \"xfce4\"$' >/dev/null 2>&1; 
then DE=xfce;
    fi
}

-- 
Benoit Minisini





More information about the User mailing list