Chapter 4. Scripting Konsole

Konsole does support numerous methods that can be used with D-Bus.

There are two ways to use the D-Bus interface: Qt™'s GUI qdbusviewer and the command line qdbus.

Examples:

  • % qdbus will display all services available.

  • % qdbus org.kde.konsole will display the D-Bus interface for Konsole.

  • % qdbus org.kde.konsole /Windows/1 will display methods for controlling window 1.

  • % qdbus org.kde.konsole $KONSOLE_DBUS_WINDOW will display methods for controlling the current window.

  • % qdbus org.kde.konsole /Sessions/1 will display methods for controlling session 1.

  • % qdbus org.kde.konsole $KONSOLE_DBUS_SESSION will display methods for controlling the current session.

  • % qdbus $KONSOLE_DBUS_SERVICE $KONSOLE_DBUS_SESSION will display methods for controlling the current Konsole's session.

If any of the above commands outputs: Service 'org.kde.konsole' does not exist, change org.kde.konsole to one of the following:

  • org.kde.konsole-`pidof -s konsole` (will select first pid)

  • $KONSOLE_DBUS_SERVICE (this can be used from the current Konsole)

  • select one from the output of 'qdbus | grep konsole'

For more information, please visit D-Bus tutorial.