Can I use two or more different profiles used in my console as the same time?

Since, I always ssh to the other machines ,e.g. servers. in my console.
Somehow, I always mix it up with my current PC.

I want to use 2 different profiles for different environments.
Say, in server console, I use red background color.
in my pc console, I use green background color such that i can easily distinguish out.

When you say console, do you mean in your terminal windows (Gterm, XTerm, rxvt, ATerm, etc.), or are you out of X completely and only at the command prompt with no GUI to speak of?
–
Matrix MoleJul 9 '11 at 4:38

yes XTerm, but if there is a way that out of X completely, that even would be better. BUt if you have solution on Xterm, gnome-terminal, it is ok!
–
Kit HoJul 9 '11 at 4:40

I wonder if we can set the background in bashrc
–
Kit HoJul 9 '11 at 4:40

1 Answer
1

You can modify a lot of the terminal settings in your ~/.Xdefaults file. This post on the gentoo forums (which will work cross distribution btw) give a lot of tweaks on how to set this information. Many of them are for urxvt, but should be easy to tweak for XTerm or even gnome-terminal unless you'd like to install urxvt (which I personally prefer).

For main console outside of X completly, the setterm program can be used to configure a lot of the screen information. Not sure how that will work in virtual terminals (xterm, etc.), but it has foreground, background, etc. color settings you can tweak. It might get called from /etc/rc.d/rc.M on your machine, or you can just build a script file for the setterm info for those times you use it. For the detailed info on setterm there is no better place than man setterm to find it.

I don't have a console on any of my linux machines, so can't test setterm out, but the .Xdefaults modifications should help you with getting screen colors inside xterm windows. Might even be able to tweak with the command line options of xterm to give different background colors based on what command line is used, then have xterm aliases for each different colored background you want.
–
Matrix MoleJul 12 '11 at 1:26