detect xfce, su(do) equivalent

Brian J. Tarricone bjt23 at cornell.edu
Thu Mar 19 19:15:53 CET 2009


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.

	-brian





More information about the Xfce mailing list