I have a program that runs on a GUI using the speech dispatcher to enhance accessibility.
The program (in C) uses the line:
speechConnection = spd_open("MyProgramme", NULL, NULL, SPD_MODE_THREADED);
which succeeds when running from the GUI.
If I use ssh to start the program remotely (or from a terminal window in another Xorg instance), it fails.
I need to define the DISPLAY and DBUS_SESSION_BUS_ADDRESS environment variables for the GTK / Gnome components to work (and they do)
USER="michael"
GDISPLAY=$(who | sed -En "s/^${USER}\s.*\((:.*)\)/\1/p")
DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/$(id -u ${USER})/bus"
sudo -H -u ${USER} -i DISPLAY=${GDISPLAY} DBUS_SESSION_BUS_ADDRESS=${DBUS_SESSION_BUS_ADDRESS} /usr/local/bin/MyProgram
Does anyone know what else is needed or what is stopping 'spd_open" from working in this scenario ?