Config
POD
NAME
App::Tasks::Config
- Configuration File for App::Tasks
SYNOPSIS
my $config = App::Tasks::Config.read-config(); say $config.reset ~ $config.header-alert-color ~ "ALERT!" ~ $config.reset;
DESCRIPTION
This file allows configuration of the App::Tasks
program via a YAML config
file.
FILE FORMAT
theme: dark immature-task-color: 'bold red' editor-command: 'nano +3,1 %FILENAME%'
First, if a theme
key is present, that is used to determine the default
colors (named the same as the class's attributres). For the config file,
the value of the colors must be valid for the Terminal::ANSIColor
module's
color
sub.
Valid themes are dark
, light
, and no-color
(you must put quotes
around "no-color" in the YAML file). The dark
theme is suitable for
people using a dark terminal background. The light
theme is suitable for
a light colored terminal background. The no-color
theme disables the ANSI
color codes in all output.
In addition to color configuration, the pager and editor commands may be specified with this configuration file.
CLASS METHODS
read-config
my $config = App::Tasks::Config.read-config($io-path);
This method optionally takes an IO::Path
argument providing the location of
the config file. If the config file is readable (using the .r
method on
the argument), it is parsed as a YAML file for the attributes listed below.
If an IO::Path object is not passed to this method, the config file should be
named $*HOME/.task.yaml
, where $*HOME
is of course your user home
directory.
from-string
my $config = App::Tasks::Config.from-file($config-text);
This method takes a string and parses it as YAML, for the attributes listed below.
no-color
my $config = App::Tasks::Config.no-color;
This is intended primarily for testing. It will return a configuration object representing a "no color" output and will not read any config files file.
COLOR ATTRIBUTES
body-color
This is the escape codes for the body text.
header-alert-color
This is the escape codes for the header alert text (values of headers that are displayed as "alerts", such as maturity dates that are in the future).
header-seperator-color
This is the escape codes for the header seperator character (the colon that appears between the header item title and the header item text).
header-title-color
This is the escape codes for the header title text.
header-normal-color
This is the escape codes for the header normal text.
immature-task-color
This is the escape codes for immature tasks in the main task list (when display of either all tasks or immature tasks is enabled).
not-displayed-today-coloor
This is the escape codes for tasks that have a frequency that would normally prevent them from being displayed in the main task list (only applicable when display of all tasks is enabled).
prompt-bold-color
This is the escape codes for bold text in the user prompt.
prompt-color
This is the escape codes for the non-bolded text in the user prompts.
prompt-info-color
This is the escape codes for informational text in the user prompts.
tag-color
This is the escape codes for tags text in task listings.
reset
This is the escape code to reset text attributes.
OTHER ATTRIBUTES
ignore-tags
This is a SetHash containing tags that are, by default, ignored by the list
and monitor
commands. It is specified in the YAML file as follows:
ignore-tags: - abc - def
The above YAML snippet wll define abc and def as "ignored tags".
editor-command
This is the command used as for editing and creating task notes. An occurance
of %FILENAME%
is replaced with a temporary file name (representing the note
to create).
The default value is:
nano -r 72 -s ispell +3,1 %FILENAME%
This uses the nano editor, with line wrapping at 72 columns. It uses ispell as the spell checker. It positions the cursor at the 3rd line, first column position.
pager-command
This is used to display all output that may span more than one page.
Any instance of %FILENAME%
is replaced by the temporary file to display.
Any instance of %PROMPT%
is replaced by a propt to provide the user to
scroll to the next page.
The default value is:
less -RFX -P%PROMPT% -- %FILENAME%
AUTHOR
Joelle Maslak <[email protected]>
LEGAL
Licensed under the same terms as Perl 6.
Copyright Ā© 2018 by Joelle Maslak