Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

or can i set the background color in .bashrc?

Thanks

share|improve this question
    
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 Mole Jul 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 Ho Jul 9 '11 at 4:40
    
I wonder if we can set the background in bashrc –  Kit Ho Jul 9 '11 at 4:40
    
Ok, I'll post answers for both scenarios –  Matrix Mole Jul 9 '11 at 4:41
add comment

1 Answer

up vote 0 down vote accepted

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.

share|improve this answer
    
sound like setterm cannot set the background color. It will change it back to original when i press Enter ... –  Kit Ho Jul 9 '11 at 10:27
    
setterm -back green –  Kit Ho Jul 9 '11 at 10:27
    
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 Mole Jul 12 '11 at 1:26
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.