detect xfce, su(do) equivalent
Christian Dywan
christian at twotoasts.de
Thu Mar 19 19:22:44 CET 2009
Am Thu, 19 Mar 2009 11:15:53 -0700
schrieb "Brian J. Tarricone" <bjt23 at cornell.edu>:
> Egon Kocjan wrote:
> > Olivier Fourdan pravi:
> >> On Thu, Mar 19, 2009 at 11:02 AM, Egon Kocjan <egon at krul.ath.cx>
> >> wrote:
> >>> How do I check, if the user is running xfce?
> >>> (for example, to detect gnome, check for env. var.
> >>> GNOME_DESKTOP_SESSION_ID)
> >>>
> >>
> >> Which is completely broken because one may set
> >> GNOME_DESKTOP_SESSION_ID on purpose to defeat programs that try to
> >> be smart by detecting the desktop (e.g. some older open office of
> >> java versions from sun)
> >
> > That's what xdg-open does I believe...
>
> Well then you might look at xdg-open to figure out how they detect
> Xfce.
>
> One option is to look for the XFCE_DESKTOP_WINDOW property on the
> root window (and then ensure that the window specified in that
> property actually exists). Though it's possible for someone to run
> xfdesktop without running Xfce. You can also check the window
> manager (see the netwm spec for how to do this) for Xfwm, but, again,
> someone could be running xfwm4 outside of Xfce.
I had posed the same question some time ago and ended up looking at the
root window. I think this should be enough for a normal Xfce
installation.
Surely somebody may be running openbox with xfdesktop, Gnome panel and
Konqueror. But at that point the user is probably not that surprised if
gksu is used instead of kdesu. ;)
Just my 2 pfennig,
Christian
More information about the Xfce
mailing list