LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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
  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
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,636

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
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
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
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
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,636

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
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
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
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: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
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



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
gnome terminal, default browser? c_olin3404 Slackware 3 07-21-2012 10:36 PM
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
default terminal (on startup) too large... samills70 Slackware 5 04-04-2005 09:21 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:57 PM.

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