fancybash - A Coloured Bash Prompt with Extra Features

fancybash is a Bash addon for inclusion into your bashrc. It adds the following (momentous) features to your Bash prompt (see screenshot, read from the left to the right):
Showing login name, hostname and pts number resp. tty; count and size of files in the current directory and directory name; jobs running in the background; current time; - most important: fancy colours!
While its colours are cyan/grey when working as unprivileged user, they change to yellow/red when becoming root (or other user with uid=0) to indicate attention. See screenshot below.

Screenshot

Screenshot

Requirements

It is a Bash addon. It needs Bash. A terminal capable showing ANSI colours would be nice, too. And it needs some stuff from (GNU) file- and textutils as well as sed, which should already be available on your system.

News

2003-01-19: Ough, that small and still contained a bug!
Fredrik Bjork <fredrik [at] silverbridge [dot] org> sent a patch to fix a tiny bug in the file counter. Please upgrade to version 1.1.

Copyright/License

fancybash ©2000,2003 Veit Wahlich <cru [at] zodia [dot] de>, released as free (libre) software under the terms of the GNU General Public License, version 2.
The author disclaims responsibility of any damage or harm caused directly or indirectly by usage of this software. Use only at your own risk.

Download

The following releases are available:

System-wide Installation - Recent Distributions

Most recent distributions offer a nice way to include extra shell scripts into the shell startup routine. So use this method if your distribution offers a /etc/profile.d/ directory:

  1. Become root:
    $ su
  2. Copy the fancybash file to /etc and rename it to fancybash.sh:
    # cp fancybash /etc/profile.d/fancybash.sh
  3. Make the file being owned by root and set it readable/executable for all other users:
    # chown root:root /etc/profile.d/fancybash.sh
    # chmod 755 /etc/profile.d/fancybash.sh
  4. Start another Bash or re-login.

System-wide Installation - Older Distributions

The following 4 steps are necessary to install fancybash in a system-wide manner: It is non-warranty - so do not blame me if something goes wrong! ;)

  1. Become root:
    $ su
  2. Copy the fancybash file to /etc:
    # cp fancybash /etc/
  3. Make the file being owned by root and set it readable for all other users:
    # chown root:root /etc/fancybash
    # chmod 644 /etc/fancybash
  4. Add an include line ". /etc/fancybash" to the end of your global Bash configuration:
    # echo ". /etc/fancybash" >>/etc/bashrc
  5. Start another Bash or re-login.

Possible Problems with System-wide Installation

fancybash was verified to work on various Linux distributions including RedHat 7.0-7.3, Debian Woody and Mandrake 8.0-8.2 with the installation process described above. Other OS and Linux distributions may have problems, try using /etc/profile instead of /etc/bashrc if inclusion from /etc/bashrc does not work. But beware this might cause problems with user shells other than Bash.
Tobias Hagemeier <tobias [at] hagemeier [dot] org> reported fancybash not working with SuSE 7.2 (and supposably other releases) when included from /etc/bashrc. He suggests including it from /etc/profile.local instead of /etc/profile because /etc/profile gets overwritten by YaST.

User-only Installation

If you do not have administrative privileges to a system but want to use it for your own login, you may include it into your very own Bash configuration:

  1. Copy the fancybash file to your home directory and name it .fancybash so it does not appear in every directory listing:
    $ cp fancybash ~/.fancybash
  2. Add an include line ". .fancybash" to the end of your private Bash configuration:
    $ echo ". .fancybash" >>~/.bashrc
  3. Now you may start another Bash or re-login.

Possible Problems with User-only Installation

Here, problems may occur likewise on various systems because usually ~/.bashrc is being included from ~/.bash_profile or even ~/.profile but it may also be not. So if you have problems getting it up and running you might try it by including it from ~/.bash_profile or ~/.profile instead of ~/.bashrc.