QCop

What is QCop?
QCop is Opie's built-in way of allowing applications to communicate with eachother (IPC), in a way similar to DCOP or DBUS. It is used a lot by Opie internally, but you can also make use of it from scripts to automate things. Another place you can easily make use of QCop is in the ButtonSettings application.

A QCop call consists of a channel (usually one per application or system component) and a message. The message resembles a function call, and some of them take arguments. Any number of applications may listen on a channel.

Buttons
In ButtonSettings, if you choose Custom as the action for a button, you can specify a QCop call to make when the button is pressed / held.

QCop command line
Opie provides a  command that you can use to make QCop calls from the command line (eg. from a shell script). You can also use it to wait for QCop calls using the  option.

Example:

qcop QPE/Application/clock "raise"

Note that sending a message to a  channel will start the application if it isn't already running.

requires the  and   environment variables to be set in order to work.

QCop Bridge
The QCop Bridge is a service that is part of Opie's launcher which provides a simple interface to run QCop calls on TCP port 4243. It is normally used by syncing applications, but you can connect to it using telnet and use it to run any QCop command you like. Access to this service is controlled by the Security Settings application.

Example session:

$ telnet 192.168.0.2 4243 Trying 192.168.0.2... Connected to 192.168.0.2. Escape character is '^]'. 220 Qtopia 1.2.1;challenge={1803a9ec-3e43-4f4f-b05a-496fde377f32};loginname=root;displayname=John Doe; USER root 331 User name ok, need password PASS mypassword 230 User logged in, proceed CALL QPE/System sendVersionInfo 200 Command okay CALL QPE/Desktop versionInfo(QString,QString) 1.7 Opie&0x20;1.2.1

Note that the QCop bridge does not allow you to make calls to applications that aren't yet running (via QPE/Application/) like the  command can. Also, the "select your sync software" option in Security settings will have an effect on responses - "Opie 1.0" will produce results like the above, whereas "Qtopia 1.7" will return encoded responses (base64 encoded UTF-16).

Messages
See QCopMessageList for an exhaustive list of messages you can send.