Tux

Jojo's Linux Page

a resource for terminal-lovers

... by Johannes 'heipei' Gilger

Introduction

This page describes my very own setup of the tools I work with 99% of the time. For me that's terminal-programs.

Since the art and efficiency behind those programs seems to be lost on most of the people today, this is meant as a reminder that terminal-programs are not the error-recovery-only black-n-white tool that most people associate it with but rather a more sophisticated and far faster way to get your job done. I expect that people reading this are savvy enough to adapt my configs to their setups so don't complain when line xy doesn't work.

For more related material you should have a look at the categories in my blog: linux, gentoo, geekstuff. Errors, typos, suggestion and the like may be submitted to my e-mail-address at: heipei ät hackvalue.de

Dotfiles (aka "the good stuff")

These contain some of the most important configs which I've put together over the years. I didn't especially clean them up so you might have to fiddle here and there to get it working. To see the effect of those files look at the screenshots below.

Screenshots

See the configs above for configuring your tools like this. Please note that not all terminals support 256 colors (xterm does, urxvt too, Iterm.app does for Mac OSX) and that some tools don't either (screen has to be patched for example). This is more a showcase page for people interested enough to invest a few afternoons of their time rather than a fool-proof installation instruction ;)
VIM 7 with my variation of the calmar256-dark colorscheme. As you can see I use a gray for background in all my applications (and the terminal). I've found it easier on the eyes and it has the advantage that you can really quickly distinguish between empty window-frames and frames with (relatively) empty terminals in it.

The colorscheme is dropped to a standard one if vim thinks your term can't handle 256 colors.
Determining when to use 256 colors and when not to is a little bit tricky with mutt. Have a look at the zshrc to see my workaround. The 'mutti' alias is something to efficiently deal with multiple IMAP mailboxes.

Colorwise mutt offers a lot of different elements which one can color. Different colors for different headers (obviously the Message-ID is not as important as the subject or the sender), different colors for different indent-levels and different colors for mails directly to you/replied-to/cced to you etc.
slrn has no problem with 256 colors, but you can't really colorize many different elements. The color of the Header-Attribute: Attribute-Content lines is the same for every attribute.
git takes colors in the form of git log --format="%s%n%C(123)%b". Have a look at my gitconfig for these output-formats.
Something I just discovered recently: You can set colors for default bold/underlined/italic fonts in your terminal. This of course affects the output of man as well. I've found this to be very readable. The * in front of line means that a search-result was found in this line. It can be enabled by appending the -J option to your $LESS env-variable.

The colors are set in the .Xdefaults.
This shows a split screen instance, with two different windows selected. screen in it's default configuration is very confusing, which is probably why not that many people use it as a window multiplexer.
This shows the prompt (green only on localhost, colored on other hosts). The [master] tag next to the clock is the current git-branch with an indicator for staged/unstaged changes.

The colors of the files are due to the dircolors file.

Howtos

ssh-askpass and ssh-agent

I use ssh, a lot. I am paranoid enough to protect my ssh-priv-key with a passphrase, yet not paranoid enough to type it everytime I open a connection. ssh-agent makes your life easier by "holding" your private-key, so you have to supply your passphrase just once, to the ssh-agent. This can be for every terminal/terminal-emulator you start or for your whole X-session. To to the latter follow these steps:
  • 1. Protect your ssh-priv-key with a passphrase. If you have an unprotected key, throw it away and generate a new pair protecting it right from the beginning this time ;).
  • 2. install ssh-agent and gtk2-ssh-askpass
  • 3. add the following to your .xinitrc (or similar) before the window-manager gets started
EXPORT SSH_ASKPASS=/usr/bin/gtk2-ssh-askpass
eval `ssh-agent`
ssh-add
If you use the method described above you might want to use a password-locked screensaver for your X, especially if your computer could physically be accessed by other people.

links


Valid HTML 4.01 Transitional Valid CSS! by Johannes Gilger, last update 26th November 2009