Renaming a Yakuake session from commandline
Asked Answered
D

2

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.

Duero answered 29/9, 2014 at 7:58 Comment(0)
H
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).

Humperdinck answered 14/10, 2014 at 1:16 Comment(2)
Cool, I'll try this out as soon as possible.Duero
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";Duero
K
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";
Kawasaki answered 26/3, 2019 at 15:15 Comment(1)
Confirming this form works for me locally. Not sure how to get remote working. The built-in GUI options seem to have no effect?Menides

© 2022 - 2024 — McMap. All rights reserved.