Update on Controlling Konsole via DBUS
Recently I wrote about controlling konsole with dbus. As I've begun to use that script for setting up my konsoles I, like others, have discovered that the tab title that you set with dbus doesn't stick. This short note shows you a workaround to make your tab titles stay put.
Even though I wrote the original post a few weeks back I didn't realize that I had a problem until now because I just this weekend upgraded the system that I use most often. Plus, apparently, I already discovered the workaround on my other system and proceeded to immediately forget about it as it took me a fair amount of fiddling to figure it out (again) today.
Before I actually (re)-discovered the workaround I did a bit of looking through the konsole code and noticed that konsole has two types of tab titles: one that's set with the function setTitle() and another that's set with the function setUserTitle(). If you don't set the one that's set with setUserTitle() then the tab title changes back to the default when you use the session. The problem is that the dbus interface allows you to call setTitle() but it does not allow you to call setUserTitle().
You can invoke setUserTitle() using konsole's menu via: Edit->Rename Tab or from the keyboard with Ctrl-Alt-S. If you set the (user) title that way you'll see that it now sticks. But that's not the workaround, since we're trying to control konsole via dbus going through and manually setting all the tab titles via the keyboard or mouse doesn't constitute a workaround.
The actual workaround on the other hand isn't without its flaws either: it requires you to change the shell profile, which means that since starting a session with a specified profile via dbus doesn't work yet, you can't have both behaviors at the same time.
After that long-winded prolog, the workaround is quite simple: using konsole's menu do: Settings->Edit Current Profile..., go to the Tabs tab and clear both the Tab title format and the Remote tab title format fields.
This works because konsole doesn't reset the tab title if there is no default value to set it to.
Mitch Frazier is an Associate Editor for Linux Journal.
Special Reports: DevOps
Have projects in development that need help? Have a great development operation in place that can ALWAYS be better? Regardless of where you are in your DevOps process, Linux Journal can help!
With deep focus on Collaborative Development, Continuous Testing and Release & Deployment, we offer here the DEFINITIVE DevOps for Dummies, a mobile Application Development Primer, advice & help from the experts, plus a host of other books, videos, podcasts and more. All free with a quick, one-time registration. Start browsing now...
- Non-Linux FOSS: Code Your Way To Victory!
- Vagrant Simplified
- Disney's Linux Light Bulbs (Not a "Luxo Jr." Reboot)
- Libreboot on an X60, Part I: the Setup
- Dealing with Boundary Issues
- System Status as SMS Text Messages
- Bluetooth Hacks
- October 2015 Issue of Linux Journal: Raspberry Pi
- New Products
- Linux and the Internet of Things