# battd A simple battery daemon written for use with a daemontools-style supervisor. `run` polls the status of a `check` function with a regular interval. On the transition from a successful `check` exit status to an unsuccessful `check` exit status the `failed` function is called. ## Installation ``` text # ./install /etc/sv/battd # ln -s /etc/sv/battd /var/service ``` Adjust the above as needed. ## Usage Configure `conf` appropriately. This should contain three functions: `interval` : Called to determine the polling interval (see below). `check` : Called to determine the battery status. `failed` : Called when the battery status has transitioned from a successful to a failing return. Optionally two variables can be set: `long_interval` : The polling interval when `interval` returns success (default: 300). `short_interval` : The polling interval when `interval` returns failure (default: 30).