LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 09-26-2008, 12:04 AM   #1
AlphaSigmaOne
Member
 
Registered: Sep 2005
Distribution: Slackware 13.1
Posts: 118

Rep: Reputation: 16
xterm Colors


How does one enable the association colors in xterm? I looked in the man page, but it's really big and I'm not exactly sure what I'm looking for. All a google got me was to try

Code:
TERM=xterm-color
or create a .bash profile file. Neither did anything.

While I'm at it, how do I go about increasing the font size? The xterm font is considerably smaller than konsole and kinda hard to read.
 
Old 09-26-2008, 12:37 AM   #2
duryodhan
Senior Member
 
Registered: Oct 2006
Distribution: Slackware 12 Kernel 2.6.24 - probably upgraded by now
Posts: 1,054

Rep: Reputation: 46
The font can be changed via the ~/.Xresources file ... for e.g mine is :

Quote:

# File : .Xresources
xterm*font: -*-fixed-medium-r-*-*-20-*-*-*-*-*-iso8859-*
xterm*font1: -*-*-*-*-*-*-2-*-*-*-*-*-*-*
xterm*font2: -misc-fixed-*-r-normal-*-8-*-*-*-*-*-iso8859-*
xterm*font3: -b&h-lucidatypewriter-bold-*-*-*-12-*-*-*-*-*-*-*
xterm*font4: -*-screen-bold-r-normal-*-16-*-*-*-*-*-iso8859-*
xterm*font5: -*-lucidatypewriter-medium-*-*-*-18-*-*-*-*-*-*-*
xterm*font6: -*-lucidatypewriter-medium-*-*-*-20-*-*-*-*-*-*-*
xterm*font7: -dec-terminal-bold-r-normal-*-14-*-*-*-*-*-iso8859-*

XTerm*background: black
XTerm*foreground: white
XTerm*pointerColor: red
XTerm*pointerColorBackground: black
XTerm*cursorColor: green
XTerm*internalBorder: 3
XTerm*loginShell: true
XTerm*scrollBar: false
XTerm*scrollKey: true
XTerm*saveLines: 1000
XTerm*multiClickTime: 250



The colors are bash specific .. your .bashrc should be able to do it .. google around , its pretty easy.
 
Old 09-26-2008, 06:45 AM   #3
IsharaComix
Member
 
Registered: Sep 2008
Location: Raleigh
Distribution: Ubuntu 8.10
Posts: 88
Blog Entries: 1

Rep: Reputation: 15
In the command line

What I do is just change it when I punch it in the command line and/or change the preferences for it:

~$xterm -fg red -bg yellow &

fg is your text color and bg is your background color. If you only want to change a few options, its easier than looking at files.
 
Old 09-26-2008, 07:51 AM   #4
Marsanghas
Member
 
Registered: Sep 2003
Location: Spijkenisse, Netherlands
Posts: 116

Rep: Reputation: 15
I think that what OP means is not the font and bg colors, but different colors when using the ls command. Is that right?

In that case you should be able to do it with an alias for ls in your .bashrc

Like:

Code:
alias ls='ls --color -a'
 
Old 09-26-2008, 09:34 AM   #5
AlphaSigmaOne
Member
 
Registered: Sep 2005
Distribution: Slackware 13.1
Posts: 118

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by duryodhan View Post
The font can be changed via the ~/.Xresources file ... for e.g mine is :




The colors are bash specific .. your .bashrc should be able to do it .. google around , its pretty easy.
That's what I was looking for, thanks.

Now a little trial and error and I should be good to go.
 
Old 09-27-2008, 12:02 AM   #6
sahko
Senior Member
 
Registered: Sep 2008
Distribution: Slackware
Posts: 1,041

Rep: Reputation: Disabled
Code:
!xterm colors
xterm*foreground:       #d3d3d3
xterm*background:       #000000
xterm*cursorColor:      orange
xterm*color0:           #151515
xterm*color8:           #505450
xterm*color1:           #bf7979
xterm*color9:           #f4a45f
xterm*color2:           #97b26b
xterm*color10:          #c5f779
xterm*color3:           #cdcda1
xterm*color11:          #ffffaf
xterm*color4:           #4a5463
xterm*color12:          #7d8794
xterm*color5:           #9c3885
xterm*color13:          #e628ba
xterm*color6:           #88aadd
xterm*color14:          #99ccff
xterm*color7:           #ffffff
xterm*color15:          #dedede

!xterm settings
xterm*dynamicColors:    true
xterm*utf8:             2
xterm*eightBitInput:    true
xterm*scrollTtyKeypress:true
xterm*scrollTtyOutput:  false
xterm*scrollBar:        false
xterm*loginShell:       true
xterm*faceName:         Terminus:pixelsize=14
xterm*jumpScroll:       true
xterm*multiScroll:      true
xterm*toolBar:          false
xterm*charClass:        33:48,35-38:48,39:43,42-47:48,58-59:48,61:48,63-64:48,126:48
This is mine. The last line is extremely useful as it automatically catches urls when clicked with the mouse.
 
Old 09-27-2008, 05:23 AM   #7
keefaz
Senior Member
 
Registered: Mar 2004
Distribution: Slackware
Posts: 4,340

Rep: Reputation: 73
I have a perl script for showing the X colors names defined in /usr/share/X11/rgb.txt
It outputs an html page

Just save it as colors.pl, chmod +x it and run it as:
Code:
./colors.pl > out.html
firefox out.html
PHP Code:
#!/usr/bin/perl

die $! unless open F"/usr/share/X11/rgb.txt";

print <<
END
<html><header><title>X Colors Names</title></header>
<
body><table>
END
;

while (<
F>) {
  
next if /^!/;
  
chomp;
  
my($num,$name) = split /t{2,}/;
  
$num =~ s/^s+//;
  
my($r$g$b) = split /s+/, $num;
  
my $hexcolor '#' sprintf "%02X%02X%02X"$r$g$b;

print <<
END
<tr>
  <
td width="50%" bgcolor="$hexcolor">&nbsp;</td>
  <
td><span style="color: $hexcolor">$name</span></td>
  <
td>rgb($r$g$b)</td>
  <
td>$hexcolor</td>
</
tr>
END
;

}

close F;
print 
"</table></body></html>\n"
 
Old 09-27-2008, 07:06 AM   #8
duryodhan
Senior Member
 
Registered: Oct 2006
Distribution: Slackware 12 Kernel 2.6.24 - probably upgraded by now
Posts: 1,054

Rep: Reputation: 46
sahko : it might help if you told the name of the file
 
Old 09-27-2008, 07:11 AM   #9
keefaz
Senior Member
 
Registered: Mar 2004
Distribution: Slackware
Posts: 4,340

Rep: Reputation: 73
I am not sahko, but I guess the conf file is ~/.Xresources

[edit]
As you already know it

Last edited by keefaz; 09-27-2008 at 07:12 AM.
 
Old 09-27-2008, 09:51 AM   #10
sahko
Senior Member
 
Registered: Sep 2008
Distribution: Slackware
Posts: 1,041

Rep: Reputation: Disabled
actually i use .Xdefaults not .Xresources :P
 
Old 09-27-2008, 10:55 AM   #11
AlphaSigmaOne
Member
 
Registered: Sep 2005
Distribution: Slackware 13.1
Posts: 118

Original Poster
Rep: Reputation: 16
^

Actually, that was going to be my next question: whats the diff with .Xresources and .Xdefaults?

The only reason I had the question in the first place is before I was just using KDE (and thus Konsole) so it wasn't and issue. But the other day I started farting around with the other windows managers that come with Slack and fell head over heals with Fluxbox.

To that end, I've been reading a lot of Flux how-tos and they all say use .Xdefaults. I just wondered if there was a difference.
 
Old 09-27-2008, 11:51 AM   #12
keefaz
Senior Member
 
Registered: Mar 2004
Distribution: Slackware
Posts: 4,340

Rep: Reputation: 73
Quote:
Originally Posted by sahko View Post
actually i use .Xdefaults not .Xresources :P
Ouch!
I guess a ln -s .Xresources .Xdefaults might help also
 
Old 09-27-2008, 12:27 PM   #13
AlphaSigmaOne
Member
 
Registered: Sep 2005
Distribution: Slackware 13.1
Posts: 118

Original Poster
Rep: Reputation: 16
One other thing, is there a line I can add that will show those bash login quote things of Pat's? I like those.
 
Old 09-27-2008, 01:31 PM   #14
sahko
Senior Member
 
Registered: Sep 2008
Distribution: Slackware
Posts: 1,041

Rep: Reputation: Disabled
Quote:
Originally Posted by AlphaSigmaOne View Post
^

Actually, that was going to be my next question: whats the diff with .Xresources and .Xdefaults?

The only reason I had the question in the first place is before I was just using KDE (and thus Konsole) so it wasn't and issue. But the other day I started farting around with the other windows managers that come with Slack and fell head over heals with Fluxbox.

To that end, I've been reading a lot of Flux how-tos and they all say use .Xdefaults. I just wondered if there was a difference.
I have been using window managers for years, dwm the last 2 and always using an .Xdefaults file. IIRC .Xresources is the "oldschool way" to do it.

http://newsgroups.derkeiler.com/Arch.../msg00024.html says that thats the other way around.

As for a symlink i havent got any but it works for me despite that.

Last edited by sahko; 09-27-2008 at 01:34 PM.
 
Old 09-27-2008, 02:10 PM   #15
keefaz
Senior Member
 
Registered: Mar 2004
Distribution: Slackware
Posts: 4,340

Rep: Reputation: 73
the /etc/X11/xinit/xinitrc.* scripts seem to rely on $HOME/.Xresources though
only xinitrc.xfce seems to care about $HOME/.Xdefaults
 
  


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
Setting xterm font and colors. ErV Linux - Software 1 05-04-2007 05:09 AM
man pages with colors in xterm milod Linux - Software 4 03-30-2006 11:34 PM
rxvt/xterm colors macondo Debian 2 04-20-2004 07:10 PM
ls colors in xterm/rxvt/aterm Pougan Linux - Software 8 12-01-2003 11:24 AM
Environment Variables: xterm, ls, mc, and emacs colors kulitpuro Slackware 4 09-01-2003 01:06 AM


All times are GMT -5. The time now is 12:24 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