| QPaMaT-Manual | ||
|---|---|---|
| Prev | ||
To remote-control QPaMaT, D-Bus is used. D-Bus is a simple, popular inter process communication mechanism on Linux and other Unix flavours. For now, it doesn't exist on Windows and MacOS. This means that the D-Bus API is only available on Unix.
For more information, see http://dbus.freedesktop.org or http://en.wikipedia.org/wiki/D-Bus.
QPaMaT offers the service de.berlios.Qpamat. So far, the only object is /Qpamat. That object implements (apart from standard interfaces provided by the Qt API) de.berlios.qpamat.Qpamat following method:
That function takes no parameters. If the main window is hidden to the system tray, it shows the main window. Otherwise, i.e. if the main window is shown, it hides it. It performs the same action as clicking on the system tray icon.
QPaMaT only exports the function, it doesn't provide a capability to actually call that function. However, that's not necessary. You can use dbus-viewer which comes with Qt 4.2 to interactively browse the exported services, objects and methods of an application.
You can use dbus-send to call the only exported showHideApplication function. Just use following command:
dbus-send --print-reply \ --dest=de.berlios.Qpamat \ /Qpamat \ de.berlios.qpamat.Qpamat.showHideApplication |
This function is suitable to bind it to a key. For example, you can use the xbindkey tool which can execute arbitrary programs on key click. Most desktop environments like KDE or Xfce also have this capability without using external programs.