LinuxQuestions.org
Review your favorite Linux distribution.
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 07-17-2011, 04:21 AM   #1
ADX
Member
 
Registered: Jul 2011
Location: 127.0.0.1
Distribution: Slackware64-13.37
Posts: 47

Rep: Reputation: 0
Angry Xterm, ls colors, and confusion


I'm having difficulty setting custom ls colors in xterm. If I understand it right one can edit the system-wide file located in /etc/DIR_COLORS to modify every terminal or customize xterm; I chose xterm mostly because the other terminals I never use. Here is my .bash_profile and .bashrc respectively:

Quote:

if [ -f ~/.bashrc ]; then
source ~/.bashrc
fi
Quote:
if [ -f /etc/bashrc ]; then
source /etc/bashrc
fi

alias ls='ls --color -F'
PS1='\[\e[1;32m\][\u@\h:\w]\$\[\e[0m\] '
When I use the login shell, the colors are different than xterm in that they are not as bright; furthermore, I marked out bold fonts in .Xresources:

Quote:
!xterm colors
xterm*foreground: #d3d3d3
xterm*background: #000000
xterm*boldColors: false
xterm*cursorBlink: true
xterm*cursorColor: white
xterm*loginShell: false
xterm*faceName: Liberation Mono
xterm*faceSize: 10
So, there must be a file around somewhere that is changing the colors between the interactive and login shells...

Also,

man xterm:
Quote:
color6 (class Color6)

color7 (class Color7)

These specify the colors for the ISO-6429 extension. The defaults are, respectively, black, red3, green3, yellow3, a customizable dark blue, magenta3, cyan3, and gray90. The default shades of color are chosen to allow the colors 8-15 tobe used as brighter versions.
How does that get anyone anywhere with setting the color? It doesn't say what color (class) is assigned to which file specifically, thus adhering to the distribution-wide color codes. Perhaps I am making this more difficult than it should be.

Last edited by ADX; 07-17-2011 at 04:50 AM.
 
Old 07-17-2011, 04:29 AM   #2
cacao74
LQ Newbie
 
Registered: Sep 2009
Location: Turin, Italy
Distribution: Slackware
Posts: 14

Rep: Reputation: 0
What happens if you launch two different xterm ?
Code:
- one with "xterm"
- the other one with "xterm -e 'bash -l'"

Last edited by cacao74; 07-17-2011 at 04:31 AM. Reason: text formatting
 
Old 07-17-2011, 04:34 AM   #3
ADX
Member
 
Registered: Jul 2011
Location: 127.0.0.1
Distribution: Slackware64-13.37
Posts: 47

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by cacao74 View Post
What happens if you launch two different xterm ?
Code:
- one with "xterm"
- the other one with "xterm -e 'bash -l'"
Nothing changes.
 
Old 07-17-2011, 04:37 AM   #4
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,979

Rep: Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850
Hello ADX,

the .bashrc file in your home-directory is only sourced if bash runs not as a login-shell. If it is a login-shell the file /etc/profile is sourced and (if it exists) the .profile in you home-directory. You should read in the manpage of bash about which files are sourced.

Note that the manpage-reader is less, less comes with vi-keybindigs and you can search within the manpage for example with the command
Code:
/.bashrc
for the occurence of ".bashrc".

BTW, normally with a stock Slackware install all colors are set properly for any terminal.

Markus

Last edited by markush; 07-17-2011 at 04:38 AM.
 
Old 07-17-2011, 04:44 AM   #5
cacao74
LQ Newbie
 
Registered: Sep 2009
Location: Turin, Italy
Distribution: Slackware
Posts: 14

Rep: Reputation: 0
Quote:
Originally Posted by ADX View Post
Nothing changes.
search for "login" in xterm's man page.
the description of the "-ls" option may be useful for you.
Code:
       -ls     This  option  indicates  that  the shell that is started in the
               xterm window will be a login shell (i.e., the  first  character
               of  argv[0]  will  be  a  dash, indicating to the shell that it
               should read the user's .login or .profile).

               The -ls flag and the loginShell resource are ignored if  -e  is
               also  given,  because xterm does not know how to make the shell
               start the given command after whatever it does  when  it  is  a
               login  shell  - the user's shell of choice need not be a Bourne
               shell after all.  Also, xterm -e is supposed to provide a  con-
               sistent functionality for other applications that need to start
               text-mode programs in a window,  and  if  loginShell  were  not
               ignored, the result of ~/.profile might interfere with that.

               If you do want the effect of -ls and -e simultaneously, you may
               get away with something like
                      xterm -e /bin/bash -l -c "my command here"

               Finally, -ls is not completely  ignored,  because  xterm -ls -e
               does  write  a  /var/adm/wtmp  entry  (if configured to do so),
               whereas xterm -e does not.
 
  


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
[SOLVED] Colors on Konsole and xterm Geriao Slackware 2 12-24-2009 06:26 PM
How to configure Xterm colors if my xterm can support 256 colors n179911 Linux - Software 4 07-06-2009 03:28 AM
XTerm Colors ewolf Linux - Software 1 10-16-2008 12:03 AM
xterm Colors AlphaSigmaOne Slackware 21 09-29-2008 08:31 AM
rxvt/xterm colors macondo Debian 2 04-20-2004 08:10 PM


All times are GMT -5. The time now is 07:03 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration