Freitag, 5. August 2016

[QDBUS] Create tabs in yakuake and pidgin, not dolphin

QDBus is an easier way to interact with DBus then using dbus-send. There is also a GUI qdbusviewer that might help finding and executing stuff. But qdbus and grep seem to be a bit better at that for me.

Executing qdbus will show all services that you can talk to via dbus. Given a servicename it will print possible paths and sub-paths. And when a path is also appended then it will print out methods and signals which can be called or registered to. The output will include the names and types of parameters and the return-type.

You see the missing 5 and 6 in Sessions and Windows? That is because I already closed them and yakuake is not reusing those numbers but continues its numbering.
For now /Sessions/1 and /yakuake/sessions are the paths we need.

We have some possibilities to do what we want. We know that after starting yakuake we have a session 1. We can already put some stuff in there. Either execute a command or insert some text. This is done either in /Sessions/1 via

For pidgin we do a bit more to open new conversations. First get the number of your account and then open a new conversation window. Do you know the account name and protocol? Then use PurpleAccountsFind. I thought I knew but couldn't find a thing. With PurpleAccountsGetAll I found the numbers to all accounts. Put a number in PurpleAccountGetUsername and PurpleAccountGetProtocolId (and not PurpleAccountGetProtocolName) and you will have the account name and protocol that can be used in PurpleAccountsFind.

To open a new conversation with your buddy you need his(her) name. Either check pidgin or got through all numbers found in im.pidgin.purple.PurpleInterface.PurpleBlistGetBuddies and get their names via im.pidgin.purple.PurpleInterface.PurpleBlistGetBuddies.

I can trigger this and it will open a new tab. But how to change its location? replace_location ? I can trigger that one too. It will mark the location for change. But then I would need to click and change it myself. Not what is wanted.