LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 12-10-2009, 02:32 AM   #1
ashok.g
Member
 
Registered: Dec 2009
Location: Hyderabad,India
Distribution: RHEl AS 4
Posts: 215

Rep: Reputation: 32
Customized Default Terminal


When we open a terminal we will get the black text with white background. I can change these as fallows for example:
Code:
$ echo -e "\033[46m"
$ echo -e "\033[34m"
$ clear
this settings will be erased whenever you close or exit from the terminal. I want to make these settings by default such that when I open a terminal these customized settings must be done.
How can I achieve this?
 
Old 12-10-2009, 09:14 PM   #2
TB0ne
Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 10,002

Rep: Reputation: 1189Reputation: 1189Reputation: 1189Reputation: 1189Reputation: 1189Reputation: 1189Reputation: 1189Reputation: 1189Reputation: 1189
Quote:
Originally Posted by ashok.g View Post
When we open a terminal we will get the black text with white background. I can change these as fallows for example:
Code:
$ echo -e "\033[46m"
$ echo -e "\033[34m"
$ clear
this settings will be erased whenever you close or exit from the terminal. I want to make these settings by default such that when I open a terminal these customized settings must be done.
How can I achieve this?
Put the settings into your .bashrc or your .profile.
 
Old 12-12-2009, 03:00 AM   #3
ashok.g
Member
 
Registered: Dec 2009
Location: Hyderabad,India
Distribution: RHEl AS 4
Posts: 215

Original Poster
Rep: Reputation: 32
Quote:
Originally Posted by TB0ne View Post
Put the settings into your .bashrc or your .profile.
When I keep the code in .bashrc I am getting what I want. But, I keep the same in .bash_profile I am not able to get it. Why?
Also, can you explain me the importance of both these files?
 
Old 12-14-2009, 01:00 AM   #4
ashok.g
Member
 
Registered: Dec 2009
Location: Hyderabad,India
Distribution: RHEl AS 4
Posts: 215

Original Poster
Rep: Reputation: 32
Also after I use the command " ls " I am getting back to my default settings rather than my customised settings. Why?
 
Old 12-16-2009, 05:04 AM   #5
ashok.g
Member
 
Registered: Dec 2009
Location: Hyderabad,India
Distribution: RHEl AS 4
Posts: 215

Original Poster
Rep: Reputation: 32
If I want to get the script run soon after I login to system where should I place this script?
 
Old 12-16-2009, 09:01 AM   #6
MTK358
LQ 5k Club
 
Registered: Sep 2009
Distribution: Arch x86_64
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 707Reputation: 707Reputation: 707Reputation: 707Reputation: 707Reputation: 707Reputation: 707
Quote:
Originally Posted by ashok.g View Post
Also after I use the command " ls " I am getting back to my default settings rather than my customised settings. Why?
Because ls uses those same escape codes to color different file types differently, and then sets the color back to normal so that all your subsequent commands won't be colored like the last listed file.

It's probably a better idea to set the color scheme in your terminal emulator than using escape codes.

Last edited by MTK358; 12-16-2009 at 09:04 AM.
 
Old 12-17-2009, 12:14 AM   #7
ashok.g
Member
 
Registered: Dec 2009
Location: Hyderabad,India
Distribution: RHEl AS 4
Posts: 215

Original Poster
Rep: Reputation: 32
Quote:
Originally Posted by MTK358 View Post
It's probably a better idea to set the color scheme in your terminal emulator than using escape codes.
How do I set the color scheme in my terminal emulator?
 
Old 12-17-2009, 09:07 AM   #8
TB0ne
Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 10,002

Rep: Reputation: 1189Reputation: 1189Reputation: 1189Reputation: 1189Reputation: 1189Reputation: 1189Reputation: 1189Reputation: 1189Reputation: 1189
Quote:
Originally Posted by ashok.g View Post
How do I set the color scheme in my terminal emulator?
You go into the settings, and change them. Without saying WHICH terminal emulator you're using, how can we give you details?? Each one is different, so find the settings menu, and look.
 
Old 12-17-2009, 09:57 AM   #9
MTK358
LQ 5k Club
 
Registered: Sep 2009
Distribution: Arch x86_64
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 707Reputation: 707Reputation: 707Reputation: 707Reputation: 707Reputation: 707Reputation: 707
GNOME Terminal:

Edit->Profile Preferences->Colors

Konsole (KDE4):

Settings->Edit Current Profile->Appearance

xterm:

Code:
$ xterm -bg <background color name> -fg <text color name>
Color Names: http://en.wikipedia.org/wiki/X11_colors

Last edited by MTK358; 12-17-2009 at 09:58 AM.
 
Old 12-17-2009, 11:55 PM   #10
ashok.g
Member
 
Registered: Dec 2009
Location: Hyderabad,India
Distribution: RHEl AS 4
Posts: 215

Original Poster
Rep: Reputation: 32
Thanks all for your help...
 
Old 12-18-2009, 01:23 PM   #11
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Slackware 13.37, Debian Squeeze
Posts: 7,987
Blog Entries: 25

Rep: Reputation: 1009Reputation: 1009Reputation: 1009Reputation: 1009Reputation: 1009Reputation: 1009Reputation: 1009Reputation: 1009
Quote:
Originally Posted by ashok.g View Post
Thanks all for your help...
Does that mean you have solved the problem completely? If so, please post what you did for the benefit of anyone else having a similar problem who finds this thread (and use "Thread tools" to mark the problem solved). If not please tell us of any remaining issues.
 
  


Reply

Tags
customized, terminal


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
default to | less in terminal muddywaters Linux - General 1 05-21-2006 05:15 AM
How to change default Terminal in GNOME? adam-red Linux - General 4 04-13-2006 11:24 PM
gnome-terminal default geometry dunric Linux - Software 1 11-09-2005 02:02 AM
gnome terminal, default browser? c_olin3404 Slackware 2 06-19-2005 05:10 PM
default terminal (on startup) too large... samills70 Slackware 5 04-04-2005 09:21 AM


All times are GMT -5. The time now is 04:39 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
Open Source Consulting | Domain Registration