How to make use of a config file.

Configuring via a config file

It is possible to set default values for various parameters within a config file. The file should be placed in the root directory and given the name .cw_config.


The configurable options are:

  • wpm
  • book_name
  • book_dir
  • play_command
  • success_colour
  • fail_colour
  • list_colour
  • word_count

An example config file looks as follows:

 # .cw_config

wpm             = 18
book_name       = book_to_read.txt
book_dir        = books
play_command    = /usr/bin/afplay
success_colour  = green
fail_colour     = orange
list_colour     = cyan
word_count      = 16


By creating this config file the wpm command may be omitted in the cw script. Alternatively this configured value will be overridden if the wpm command is used in a cw script.

Tags: tutorial