change konsole-profile according to application in KDE

0

0

Using the Konsole terminal-emulator with KDE on Kubuntu 9.10 , I would like to have a different konsole profile (colors, icons) whenever I ssh into a server, so I can easily spot in which konsole tab i'm on the local machine and which i'm on the remote server. I have the different profiles set up, as for now I change that profile manually from the gui ...

Jakob Cosoroaba

Posted 2009-12-18T12:39:50.287

Reputation: 1 661

should this be moved to serverfault ? – Jakob Cosoroaba – 2009-12-18T13:02:26.577

Answers

0

The way to go is to alter the bashrc on the remote server, and set there a different text color.

Jakob Cosoroaba

Posted 2009-12-18T12:39:50.287

Reputation: 1 661

0

I would add the user@host prefix to the window title (which konsole can use for its tabs (%w in the konsole profile)).

blueyed

Posted 2009-12-18T12:39:50.287

Reputation: 1 071

0

The best way I have found is to create bash aliases to connect the servers. For example:

alias resetcolors="konsoleprofile colors=Local"
alias ssh-saturn="konsoleprofile colors=SaturnColors; ssh -X saturn; resetcolors; echo 'Welcome back'"'!'

Where saturn is the name of the server, SaturnColors is the desired profile when connected to the server, Local is your default color scheme for your localhost, and -X is whatever ssh flags you want to use. Now, when you type ssh-saturn, the konsole colors will change and you will connect to the server, after which, your color scheme will be reset (and receive a welcome back message).

This assumes that you have setup ssh keyless login.

Jonathan

Posted 2009-12-18T12:39:50.287

Reputation: 148