Customizing XTerm

July 24th, 2008 Pekk Posted in Computers, Linux |

Since I’m now using fluxbox I decided to try out something else that’s a bit new to me: xterm. If you’ve ever seen an XTerm window before you might agree that its appearance is rather bland and dull, so after some super brief research I’ll post the changes I made.

First thing I did (which I do with all of my terminals) is change my prompt. that “bash$” prompt is just so boring! My settings however are pretty extreme—since the escape sequences are very confusing in large quantities I divided my prompt into separate variables which then all combine to make the final PS1. I placed the following in ~/.bashrc (note on my Mac I have this stuff in ~/.profile)


TITLEBAR="\u@\h \w"
TITLEBAR="\e]2;$TITLEBAR\a"
CURDIR="\W"
HISNUM="\[\e[37m\](\[\e[32m\]\!\[\e[37m\]) "


export PS1="\[$TITLEBAR\]$HISNUM\[\e[33m\]$CURDIR\[\e[37m\]/ \[\e[32;1m\]\\$ \[\e[0m\]"
export PS2="\[\e[32;1m\]>\[\e[0m\] "

For more information about customizing your prompt, check out Gentoo’s awesome documentation, Prompt Magic. The next thing of course, since my terminal prompt uses white foreground colors was to change the background color of my xterm. After some brief searching I found out about a file called .Xdefaults in the home directory which can be edited. My ~/.Xdefaults looks like this now:


xterm*background: #000000
xterm*foreground: #FFFFFF

Since I just was not happy with my `ls’ output, I went back to ~/.bashrc and added the following alias for ls:


alias ls="ls -F --color=always"

That’s it for today! I’ll be back with some more customizing tips later! PEACE!

Leave a Reply

You must be logged in to post a comment.