Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change konsole tab title from command line and make it persistent?

How can I change the konsole tab title? By default, it's set to %u : %n, so it always changes automatically.

I can set it with:

qdbus org.kde.konsole $KONSOLE_DBUS_SESSION setTitle 1 "My Title"

But as soon as you run something in the console, it changes back to %u : %n. Of course. I can set it to %w to tell it to set the title to "Window Title set by shell", but later (if I don't explicitly set it), it will be empty. (Every new tab will be empty, unless I set it.)

The question is how to make it persistent (or how to switch profile via command line)? I can make another profile in which the title format is set to %w, and before I set my custom title, switch to that profile.

enter image description here

enter image description here

edit: I think I have found the answer

qdbus org.kde.konsole $KONSOLE_DBUS_SESSION setTabTitleFormat 0 "" qdbus org.kde.konsole $KONSOLE_DBUS_SESSION setTitle 0 "My Title"

like image 657
Shuman Avatar asked Nov 11 '13 02:11

Shuman


People also ask

How do I rename a tab in Konsole?

All newly created tabs will be named the same. You can give any konsole its "name" by calling the function in its first tab. You might need to clobber the file .

How do you run Konsole?

Start Konsole in the background and bring to the front when Ctrl+Shift+F12 (by default) is pressed. Run the new instance of Konsole in a separate process. Show the menubar, overriding the default behavior. Hide the menubar, overriding the default behavior.


1 Answers

You may need to use this variant:

echo -ne "\033]30;test change title\007"

$ konsole -v
Qt: 4.8.6
KDE Development Platform: 4.13.3
Konsole: 2.13.2
like image 176
Tim Avatar answered Oct 14 '22 07:10

Tim