Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Renaming a Yakuake session from commandline

Yakuake provides a hotkey and a GUI way to rename commandline tabs/sessions.

I'd like to do the same via the command line, so I can script it and use it in an alias. (My goal is that if I use an alias which does an SSH to some server, then the tab is renamed according to this servers name...)

I tried the suggestions shown here Renaming a Konsole session from commandline after ssh so far no luck.

like image 518
fgysin Avatar asked Sep 29 '14 07:09

fgysin


2 Answers

Since KDE4, one should use qdbus to control KDE apps (instead of deprecated and deleted DCOP). For example, to change a title of the first session one may use:

qdbus org.kde.yakuake /Sessions/1 org.kde.konsole.Session.setTitle 1 "New title"

To explore available interfaces, methods and properties one may use qdbusviewer.

As a homework try to get a list of active sessions (before you going to change smth).

like image 94
zaufi Avatar answered Oct 20 '22 23:10

zaufi


Like @fgysin pointed out, his command also works for me. BUT it needs the ` character and not " for the subcommand :

qdbus org.kde.yakuake /yakuake/sessions org.kde.yakuake.activeSessionId

It gives :

qdbus org.kde.yakuake /yakuake/tabs org.kde.yakuake.setTabTitle `qdbus org.kde.yakuake /yakuake/sessions org.kde.yakuake.activeSessionId` "NEW TAB TITLE";
like image 30
ToYonos Avatar answered Oct 21 '22 01:10

ToYonos