not being a programmer nor the son of one, I didn't see the connection.
That's OK, I completely understand.
I looked at dcop
some while ago: It seemed very clever, flexible and useful, but I did (do) not have any particular problems that it might have solved for me, so I just put it aside.
But I think it'll do what you want (and much
more). As an example, copy & paste this into a konsole
dcop $KONSOLE_DCOP_SESSION renameSession 'Amazing New Title'
Then check your konsole window's title bar.
See what I mean?
Sorry, I do not have links to tutorials and such, because I do not need it (dcop) and am way too busy with other stuff, but google is your friend!