setting default xterm colors

2005-04-27 Thread Carlo Florendo
Hello,
Does anyone know a way to set xterm colors without using the -bg and -fg 
options all the time?I know one way to do it would be to alias xterm 
in bash_profile such that the command always includes the bg and fg 
options every time it is invoked. Aliasing works for me but this is not 
what I want. 

I've exported TERM=xterm-color
Some sites say that .Xdefaults have to be set but it means I have to set 
the .Xdefaults for each and every user.  I would want users to read 
terminal settings from a global configuration file.  It seems that there 
is no such thing.

I've uncommented the necessary options from 
/usr/lib/X11/app-defaults/Xterm-color so that I get a light foreground 
over a dark background . In particular, the relevant section of 
/usr/lib/X11/app-defaults/Xterm-color now looks like:

$ cat /usr/lib/X11/app-defaults/XTerm-color | more
snipped_upper
#include XTerm
*VT100*colorMode: on
*VT100*boldColors: on
*VT100*dynamicColors: on
! Uncomment this for white text on a dark background.
*VT100*foreground: gray90
*VT100*background: black
snipped_lower
Also, my TERM is:
$ echo $TERM
xterm-color
Thanks for any help.
Best Regards,
Carlo
--
Carlo Florendo
Astra Philippines Inc.
www.astra.ph


Re: setting default xterm colors

2005-04-27 Thread Carlo Florendo
Alexander Gottwald wrote:
On Wed, 27 Apr 2005, Carlo Florendo wrote:
 

Hello,
Does anyone know a way to set xterm colors without using the -bg and -fg 
options all the time?I know one way to do it would be to alias xterm 
in bash_profile such that the command always includes the bg and fg 
options every time it is invoked. Aliasing works for me but this is not 
what I want. 
   

man xterm lists a huge number of commandline options and their respective
resources. 
-bg = background
-fg = foreground

These resources can either be set in /usr/lib/X11/app-defaults/XTerm* 
but these changes will get lost with the next xterm update or in ~/.Xdefaults
You may also create a global file /usr/X11R6/lib/X11/xinit/.Xresources and import 
tzhe settings with 

xrdb -merge /usr/X11R6/lib/X11/xinit/.Xresources
If you're using startx to start the xserver, it will automaticly read the settings 
from these files (in this order)
/usr/X11R6/lib/X11/xinit/.Xresources
$HOME/.Xdefaults

The syntax of these files is the same as in /usr/lib/X11/app-defaults/XTerm*
bye
	ago
 

Thank you very much Alexander.  I have been very enlightened with your 
posting.  :)

I've got a follow-up question:  I run startx and an xterm fires up.  
That's no problem.   When I invoke another xterm from the xterm that 
just started, I now get the proper background and foreground colors but  
`ls -l' does not display color coded directory entries anymore on the 
newly invoked xterm (It does display the colors from the xterm invoked 
by startx, though).   Everything would work fine if I invoke `xterm -e 
/bin/bash --login -i' since I've aliased ls to `ls --color=auto' in my 
bash configuration file.  Is there any way to make my xterm understand 
`ls --color-auto' without loading the shell configuration files (since 
it's from my bash configuration that I set `ls --color-auto')?

Thank you so much for your prompt reply!
Best Regards
Carlo
--
Carlo Florendo
Astra Philippines Inc.
www.astra.ph


Re: setting default xterm colors

2005-04-27 Thread Alexander Gottwald
On Wed, 27 Apr 2005, Carlo Florendo wrote:

 I've got a follow-up question:  I run startx and an xterm fires up.  
 That's no problem.   When I invoke another xterm from the xterm that 
 just started, I now get the proper background and foreground colors but  
 `ls -l' does not display color coded directory entries anymore on the 
 newly invoked xterm (It does display the colors from the xterm invoked 
 by startx, though).   Everything would work fine if I invoke `xterm -e 
 /bin/bash --login -i' since I've aliased ls to `ls --color=auto' in my 
 bash configuration file.  Is there any way to make my xterm understand 
 `ls --color-auto' without loading the shell configuration files (since 
 it's from my bash configuration that I set `ls --color-auto')?

No that I know of. But bash knows two kinds of configuration files.

~/.bashrc and ~/.profile (see man bash for details). .profile is read 
when invoked with --login otherwise .bashrc. you can put the alias command
to .bashrc and source that from .profile too

==~/.bashrc==
alias ls=ls --color=auto

==~/.profile==
if test -f ~/.bashrc; then
. ~/.bashrc
fi

bye
ago
-- 
 [EMAIL PROTECTED] 
 http://www.gotti.org   ICQ: 126018723