This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Display device hostname through ssh instead of ip

Tags: konsole, ssh, script konsole, ssh, script konsole, ssh, script
(comma "," separated)
aparis
Registered Member
Posts
3
Karma
0
Hello all,
I am using the following version of konsole with mint 17 kde
Qt: 4.8.6
KDE Development Platform: 4.14.2
Konsole: 2.14.2

During my shift i log in to many networking devices via ssh and i would like the host name to appear to the tab instead of ip address [it can be both also]

I tried the following script but it didnt work, any suggestions please?
http://www.linuxquestions.org/questions ... on-484981/
Code: Select all
#!/bin/bash
# This script is called "konsole_tabname"

if [ -n "$KONSOLE_DCOP_SESSION" ] ; then
    dcop $KONSOLE_DCOP_SESSION sessionName
    dcop $KONSOLE_DCOP_SESSION renameSession "$1" 2> /dev/null 1>&2
fi

You could then write a little wrapper for ssh like this:

Code:

#!/bin/bash
# This script is called "kssh".  DO NOT call it ssh or it
# will call itself recursively!

old_tab_title="$(konsole_tabname "ssh session")"
ssh "$@"
konsole_tabname "$old_tab_title" > /dev/null



Regards.
User avatar
scummos
Global Moderator
Posts
1175
Karma
7
OS
Looks like that uses DCOP, which is dead since ... 10 years? You can probably do the same with qdbus, if you poke around in konsole's dbus API a bit.


I'm working on the KDevelop IDE.
luebking
Karma
0
Code: Select all
qdbus $KONSOLE_DBUS_SERVICE $KONSOLE_DBUS_SESSION setTitle 1 foobar
aparis
Registered Member
Posts
3
Karma
0
Thank you for your reply,
Your suggestion is working but when i hit enter or submit some command the tab title changes back to the old value.
Any ideas how to solve this?
Regards.
luebking
Karma
0
"Edit current profile..."/Tabs - get rid of the program name invocation (in doubt just clear the line for remote sessions)
aparis
Registered Member
Posts
3
Karma
0
Hello,
When I delete the "remote tab title format" its taking the "profile" name [tab general-->profile name].
Can I check something else?
Regards.
luebking
Karma
0
Yes, but it should no longer alter it after you set it?
luebking
Karma
0
PS: no idea whether that helps you, but "%w" set the shell prompt as title.


Bookmarks



Who is online

Registered users: Bing [Bot], daret, Google [Bot], Sogou [Bot]