You are not logged in.

#1 2009-03-04 13:38:04

markisthejob
Member
From: Cork, Ireland
Registered: 2008-09-01
Posts: 63

Any way to add a bit of color? [SOLVED]

Hi all.I returned to Arch from Gentoo recently and the one thing I miss is having different colored text in the console.I dont mean I want to change the font colour - I mean to have a number of different colors in the text so its easier to read.
Something along the lines of pacman-color but for the whole console.Is this possible at all.

Last edited by markisthejob (2009-03-04 16:34:08)

Offline

#2 2009-03-04 13:45:37

djnm
Member
From: USA
Registered: 2008-12-21
Posts: 78

Re: Any way to add a bit of color? [SOLVED]

Well your .bashrc defines some colors for text, and some commands output in color like "ls --color=auto" and "grep --color=auto"

Also most programs (weechat, irssi, ncmpcpp, vim, emacs) support different colors and syntax highlighting.

So, yes, it is possible! You just have to play with config files.


br0tat0chip in #archlinux and on freenode

Offline

#3 2009-03-04 13:54:41

Procyon
Member
Registered: 2008-05-07
Posts: 1,819

Re: Any way to add a bit of color? [SOLVED]

Yep, check out .bashrc, aliases and PS1 threads on the forums for examples.

Offline

#4 2009-03-04 14:13:57

brazzmonkey
Member
From: between keyboard and chair
Registered: 2006-03-16
Posts: 818

Re: Any way to add a bit of color? [SOLVED]


what goes up must come down

Offline

#5 2009-03-04 16:33:29

markisthejob
Member
From: Cork, Ireland
Registered: 2008-09-01
Posts: 63

Re: Any way to add a bit of color? [SOLVED]

thanks for the fast replies.I wasnt sure what to search for before.I have exactly what I want now.

Offline

#6 2009-03-04 20:11:55

aaaantoine
Member
Registered: 2008-12-12
Posts: 44

Re: Any way to add a bit of color? [SOLVED]

There's actually a commented line in .bashrc that colors your prompt for you when you uncomment it.  This came in handy for me as sometimes it's difficult for me to see where the output of a command begins and ends when I run a few commands in a row.

Offline

#7 2009-03-04 23:02:41

Surgat_
Member
Registered: 2007-08-08
Posts: 317

Re: Any way to add a bit of color? [SOLVED]

aaaantoine wrote:

There's actually a commented line in .bashrc that colors your prompt for you when you uncomment it.  This came in handy for me as sometimes it's difficult for me to see where the output of a command begins and ends when I run a few commands in a row.

I don't have such a line in my .bashrc. Could you post it? Thanks.

Offline

#8 2009-03-05 02:37:51

bernarcher
Forum Fellow
From: Germany
Registered: 2009-02-17
Posts: 2,281

Re: Any way to add a bit of color? [SOLVED]

This is what I have in my .bashrc:

# Use current DIRCOLORS settings
eval `dircolors -b /etc/DIR_COLORS`

# Use colored grep output.
# Matches are bold blue:
export GREP_COLOR="1;34"
alias grep='grep --color=auto'

# Use colored display in man pages.
# Optimized for white background Xterm.
# - blinking on: magenta
export LESS_TERMCAP_mb=$'\E[35m'
# - bold on: red
export LESS_TERMCAP_md=$'\E[31m'
# - all attributes off
export LESS_TERMCAP_me=$'\E[0m'
# - exit standout mode
export LESS_TERMCAP_se=$'\E[0m'
# - begin standout mode (e.g. status line): bold yellow on blue
export LESS_TERMCAP_so=$'\E[01;44;33m'
# - exit underline mode
export LESS_TERMCAP_ue=$'\E[0m'
# - begin underline mode: blue
export LESS_TERMCAP_us=$'\E[34m'

# Use colored prompts:
#
PS1="\[\e[0;35m\]\u:\[\e[0;34m\]\w\[\e[0;35m\]\$\[\e[0;0m\] "
#
PS2="\[\e[0;35m\]>\[\e[0;0m\] "
PS3="\[\e[0;35m\]-\[\e[0;0m\] "
PS4="\[\e[0;35m\]+\[\e[0;0m\] "

Different colors in /root/.bashrc:

# Use root specific colored prompts:
#
PS1="\[\e[0;34m\]\u:\[\e[0;31m\]\w\[\e[0;34m\]#\[\e[0;0m\] "
#
PS2="\[\e[0;34m\]>\[\e[0;0m\] "
PS3="\[\e[0;34m\]-\[\e[0;0m\] "
PS4="\[\e[0;34m\]+\[\e[0;0m\] "

Last edited by bernarcher (2009-03-05 02:43:32)


To know or not to know ...
... the questions remain forever.

Offline

#9 2009-03-05 05:37:54

evilgold
Member
Registered: 2008-10-30
Posts: 120

Re: Any way to add a bit of color? [SOLVED]

Theres actually a pkgbuild to copy gentoo's .bashrc if your interested

http://aur.archlinux.org/packages.php?ID=18418

I use it on all of my systems.

Offline

Board footer

Powered by FluxBB