Human Readable   

 

     
   
     

A Slackware Desktop Enhancement Guide

Colorized Slackware rc.d Scripts

© Copyright Darrell Anderson.

Out of the box Slackware is dull and boring. Be honest Slacker die-hards—no color, no life. And really, there is no excuse for such blandness.

After having first cut my GNU/Linux baby teeth on Mandrake and becoming acclimated to the colorful boot sequence, when I migrated to Slackware I experienced a difficult and disappointing time following the boot process. Color is an easy method to use to help distinguish sections of the boot process. One of the first Slackware projects I tackled was adding color to the /etc/rc.d scripts.

[Image: Screen capture of a stock Slackware rc.M script.]

Although I examined the Mandrake boot process, I decided to provide a simpler colorization scheme. I merely added the colorization directly to the console echo messages. Nothing fancy. I created a file to house escape codes for the colors I wanted to use and then I source that file in each rc.d script. From there I edited appropriate echo messages to include color. Of course, to recognize these escape sequences means I had to add the -n option to each of the affected echo commands or use the printf command.

I also wanted consistency in the colorization. I used the following basic scheme:

  1. Bold Yellow: system initializations and run-level messages.
  2. Bold Cyan: File system messages.
  3. Bold Blue: First message in other init scripts.
  4. Bold White: secondary messages from other init scripts.
  5. Bold White: miscellaneous informational messages.
  6. Bold Green: login header messages.

The strategy has worked well for me and added some life to the otherwise boring Slackware boot process. Other messages provided by the kernel or called programs remain in standard non-bold white (almost gray on most screens). Nonetheless, this simple touch provides me a more pleasing boot environment and improves usability.

[Image: Screen capture of a colorized Slackware rc.M script.]

I also use this same scheme in many additional scripts, including those used for bash startup and logout, startx, the runlevel 3 login screen, and several custom scripts stored in /usr/local/bin and /usr/local/sbin. In addition to colorizing the scripts I liberally added additional echo or printf messages to improve feedback and help me better visualize the boot process.

Copies of the rc.d scripts I use and have modified are included in zip and tar.gzip files. Before using these files please make backups of your existing rc.d scripts and use the KDE Kompare file or command line diff utilities to understand the differences between my files and the originals. Most of the modifications are related only to colorization, but there are a tiny number of additional modifications to some of the scripts. If you like this idea you will have to modify the remaining scripts to suit your tastes.

/etc/functions-colors

rcdscripts.zip (Slackware 10.2)
rcdscripts.tar.gz (Slackware 10.2)

rcdscripts.zip (Slackware 11.0)
rcdscripts.tar.gz (Slackware 11.0)

rcdscripts.zip (Slackware 12.0)
rcdscripts.tar.gz (Slackware 12.0)

Finis.

Table of Contents