Re: How can I tell consistently if accessibility is enabled?



If you want a command, you can try

	xprop -root |grep AT_SPI_IOR

Thanks,
Harry

On Tue, 2009-06-23 at 11:11 +0800, Li Yuan wrote:
> Hi Timothy,
> 
> If you can call functions in X library, getting the root window's 
> property will tell you if accessibility is enabled.
> 
> /*--------------example code-------------*/
>      Atom AT_SPI_IOR;
>      Atom actual_type;
>      int actual_format;
>      unsigned char *data = NULL;
>      unsigned long nitems;
>      unsigned long leftover;
> 
>      AT_SPI_IOR = XInternAtom (display, "AT_SPI_IOR", False);
>      XGetWindowProperty(display,
>                         XDefaultRootWindow (display),
>                         AT_SPI_IOR, 0L,
>                         (long)BUFSIZ, False,
>                         (Atom) 31, &actual_type, &actual_format,
>                         &nitems, &leftover, &data);
> /*---------------end of example----------------*/
> 
> If data is not NULL, at-spi-registryd has been started, which means 
> accessibility is enabled.
> 
> Thanks,
> Li
> 
> 
> Timothy Renner wrote:
> > Hi,
> >
> > I'm trying to find a reliable way of telling if accessibility is
> > enabled for the current X session without using the ATK or GTK
> > libraries built into a program.  I need to be able to query the
> > system, say through a shell script, or something as equally limited.
> >
> > I was hoping to use the output from: gconftool-2 -g
> > /desktop/gnome/interface/accessibility, which will give me a true if I
> > run as the user, but unfortunately will give me a false if I run the
> > app with sudo (Which makes sense, since it's then run as root).  I
> > also can't modify the sudo call, so that's not an option.
> >
> > Anyone have a better suggestion?
> >
> > -Tim
> > _______________________________________________
> > gnome-accessibility-list mailing list
> > gnome-accessibility-list gnome org
> > http://mail.gnome.org/mailman/listinfo/gnome-accessibility-list
> >   
> 
> _______________________________________________
> gnome-accessibility-list mailing list
> gnome-accessibility-list gnome org
> http://mail.gnome.org/mailman/listinfo/gnome-accessibility-list
-- 

Harry Lu Sun COM
OpenSolaris Desktop Group, Sun Microsystems
Phone ext. 82870




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]