LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-01-2006, 08:31 AM   #1
ForumJoiner
LQ Newbie
 
Registered: Nov 2006
Posts: 5

Rep: Reputation: 0
Changing Bash Colors


I'm looking for an EASY way to change:
- background color
- foreground color
in text mode.

For instance, I start Linux in text mode, I login and I see white text on black screen. What changes should I make to .bashrc to see black text on red screen (for example?)

I'm using:
Red Hat Release 5.0 (Hurricanne)
Kernel 2.0.32
GNU bash, version 1.14.7(1)
 
Old 12-01-2006, 08:39 AM   #2
1337_penguin
Member
 
Registered: Jul 2005
Location: Brighton, UK
Distribution: Mainly Debian and Mepis, but also Slackware, Arch and Mandriva
Posts: 73

Rep: Reputation: 15
Hi

Do you mean changing the prompt and stuff?

I found this article useful:
http://www-128.ibm.com/developerwork.../l-tip-prompt/

Hope this helps.

1337_penguin
 
Old 12-01-2006, 08:41 AM   #3
Hitboxx
Senior Member
 
Registered: Mar 2006
Location: India
Distribution: Fedora
Posts: 1,562
Blog Entries: 3

Rep: Reputation: 68
http://wiki.archlinux.org/index.php/Color_Bash_Prompt
 
Old 12-01-2006, 08:42 AM   #4
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 65
Is this the virtual console screen, or are you using a terminal emulator in X?
 
Old 12-01-2006, 10:44 AM   #5
ForumJoiner
LQ Newbie
 
Registered: Nov 2006
Posts: 5

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by 1337_penguin
Hi

Do you mean changing the prompt and stuff?

I found this article useful:
http://www-128.ibm.com/developerwork.../l-tip-prompt/
I tried what they said, but it didn't work:
PS1="\[\e]2;\u@\H \w\a\e[32;1m\]>\[\e[0m\] "
my PS1 became:
\e]2;root@\H /etc/X11/fvwm2\a\e[32;1m>\e[0m

and for:
PS1="\[\e[32;1m\]\u@\H > \[\e[0m\]"
I got:
\e[32;1mroot@\H > \e[0


This, however, does work:
PS1="[\[\033[31;1m\u\[\033[0m@\[\033[34;1m\h\[\033[0m \[\033[34m\w\[\033[0m]>> "

I'm reffering to a terminal that is started from inittab, like this:
1:12345:respawn:/sbin/mingetty tty1. I don't have a X interface at all.

Is there a script that will take background and foreground colors as input and genereate the sequence?

If I change the PS1 background, it doesn't change the tty background, which is what I wanted in the first place.

Last edited by ForumJoiner; 12-01-2006 at 10:49 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing window colors Ariod Mandriva 3 09-11-2005 04:36 AM
changing prompt colors? microsoft/linux Debian 2 05-29-2005 04:22 PM
changing ls colors jsfour Slackware 7 12-04-2003 12:43 AM
changing the number of colors Robert0380 Linux - General 7 05-22-2003 07:48 AM
changing colors RaheimSG Linux - Newbie 2 09-15-2002 09:47 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:15 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration