LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 05-04-2006, 01:18 AM   #1
jitheshmurali
LQ Newbie
 
Registered: Mar 2006
Posts: 16

Rep: Reputation: 0
changing the color of cui


hello,
can any one tell me how to change the color of command user interface.
thank you
 
Old 05-04-2006, 01:38 AM   #2
vimal
Red Hat India
 
Registered: Nov 2004
Location: Kerala/Pune,india
Distribution: RedHat, Fedora
Posts: 260

Rep: Reputation: 34
Hello jitheshmurali,

Changing the colour of the bash prompt is really simple. The bash prompt is setup in the .bash_profile file, residing in the home directory of every user. The bash prompt is defined using the PS1 variable. There are excellent tutorials on setting the bash prompt. For changing the colour, you can refer to 'http://www.faqs.org/docs/Linux-HOWTO/Bash-Prompt-HOWTO.html#AEN343'.

Another URL on making the prompt really funny and different, you can refer 'http://www.dreaming.org/~giles/bashprompt/prompts/index.html'.

This simple bash script gives you the available colours that can be set for the terminal.
---------------------------------------------------------------------
#!/bin/bash
#
# This file echoes a bunch of color codes to the
# terminal to demonstrate what's available. Each
# line is the color code of one forground color,
# out of 17 (default + 16 escapes), followed by a
# test use of that color on all nine background
# colors (default + 8 escapes).
#

T='gYw' # The test text

echo -e "\n 40m 41m 42m 43m\
44m 45m 46m 47m";

for FGs in ' m' ' 1m' ' 30m' '1;30m' ' 31m' '1;31m' ' 32m' \
'1;32m' ' 33m' '1;33m' ' 34m' '1;34m' ' 35m' '1;35m' \
' 36m' '1;36m' ' 37m' '1;37m';
do FG=${FGs// /}
echo -en " $FGs \033[$FG $T "
for BG in 40m 41m 42m 43m 44m 45m 46m 47m;
do echo -en "$EINS \033[$FG\033[$BG $T \033[0m";
done
echo;
done
echo
---------------------------------------------------------------------

Thanks,,,

Last edited by vimal; 05-04-2006 at 03:01 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 text color in C++ Brakki Programming 3 04-21-2004 04:24 PM
Changing the color of ls output? exitsfunnel Linux - Newbie 1 02-19-2004 11:20 PM
changing console color? Wilson Linux - General 14 05-25-2003 09:29 PM
Changing color on taskbar jlj Linux - Newbie 1 02-17-2003 01:36 PM
Changing font color uglyvorys Linux - General 2 02-02-2003 12:39 PM


All times are GMT -5. The time now is 05:23 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration