dbusgnomebusctl

How do I access the ATSPI dbus service


How do I view the whole object tree for atspi. All docs I have read say the name for atspi's dbus service is org.a11y.atspi.Registry but I dont get that when I list both the system and session services. The docs seem to be atleast 5 years old so something might have changed over that time I guess

Currently I only see these three in the dbus session bus when I run busctl --user list

org.a11y.Bus                                       1105 at-spi-bus-laun tamara :1.24         user@1000.service -       -



:1.24                                              1105 at-spi-bus-laun tamara :1.24         user@1000.service -       -



:1.53                                              1292 at-spi2-registr tamara :1.53         user@1000.service -       -

I also have this

org.a11y.Bus                                       1105 at-spi-bus-laun tamara :1.24         user@1000.service -       -

but it does not have the methods I'm looking for


> busctl --user tree org.a11y.Bus

    └─ /org
      └─ /org/a11y
        └─ /org/a11y/bus
    


> busctl --user introspect org.a11y.Bus /org/a11y/bus

    NAME                                TYPE      SIGNATURE RESULT/VALUE FLAGS
    org.a11y.Bus                        interface -         -            -
    .GetAddress                         method    -         s            -
    org.a11y.Status                     interface -         -            -
    .IsEnabled                          property  b         false        emits-change writable
    .ScreenReaderEnabled                property  b         false        emits-change writable
    org.freedesktop.DBus.Introspectable interface -         -            -
    .Introspect                         method    -         s            -
    org.freedesktop.DBus.Peer           interface -         -            -
    .GetMachineId                       method    -         s            -
    .Ping                               method    -         -            -
    org.freedesktop.DBus.Properties     interface -         -            -
    .Get                                method    ss        v            -
    .GetAll                             method    s         a{sv}        -
    .Set                                method    ssv       -            -
    .PropertiesChanged                  signal    sa{sv}as  -            -

here

busctl --user tree org.a11y.atspi.Registry

Failed to introspect object / of service org.a11y.atspi.Registry: The name is not activatable
No objects discovered

Solution

  • For performance reasons, AT-SPI works on a completely separate bus (its own dbus-daemon instance) – i.e. on a custom bus address instead of either of the pre-defined ones.

    When connected to the session (user) bus, org.a11y.Bus acts as the "pointer". You must call the GetAddress() method on that service, which will return an address string. Then have your D-Bus library create a new bus connection to that address.

    $ busctl --user call org.a11y.Bus /org/a11y/bus org.a11y.Bus GetAddress
    s "unix:path=/run/user/1000/at-spi/bus_0,guid=0e1eb738749e34d919065fab67d8391d"
    
    $ busctl --address="unix:path=/run/user/1000/at[...]391d" list
    NAME                        PID PROCESS 
    org.a11y.atspi.Registry 3416284 at-spi2-registr
    
    $ busctl --address="unix:path=/run/use[...]391d" tree org.a11y.atspi.Registry
    └─ /org
      └─ /org/a11y
        └─ /org/a11y/atspi
          ├─ /org/a11y/atspi/accessible
          │ └─ /org/a11y/atspi/accessible/root
          ├─ /org/a11y/atspi/cache
          └─ /org/a11y/atspi/registry