5

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.

Community
  • 1
  • 1
fgysin
  • 11,329
  • 13
  • 61
  • 94

2 Answers2

7

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).

zaufi
  • 6,811
  • 26
  • 34
  • Cool, I'll try this out as soon as possible. – fgysin Oct 15 '14 at 14:20
  • 3
    You pointed me the right way, but I was not able to make it work using your string. The following worked for me: `qdbus org.kde.yakuake /yakuake/tabs org.kde.yakuake.setTabTitle "`qdbus org.kde.yakuake /yakuake/sessions org.kde.yakuake.activeSessionId`" "NEW TAB TITLE";` – fgysin Jan 26 '15 at 12:15
3

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";
ToYonos
  • 16,469
  • 2
  • 54
  • 70
  • Confirming this form works for me locally. Not sure how to get remote working. The built-in GUI options seem to have no effect? – Bill McGonigle Jul 05 '20 at 01:13