| 1 |
~~~~~~~~~~~~~~~~~~~ |
| 2 |
Local Customization |
| 3 |
~~~~~~~~~~~~~~~~~~~ |
| 4 |
|
| 5 |
.. include:: prologue.rst |
| 6 |
|
| 7 |
BRLTTY supports the XDG configuration file paradigm. The most important |
| 8 |
capability this offers is an easy way to customize your BRLTTY configuration |
| 9 |
that won't be overwritten during an upgrade, reinstall, etc. The XDG paradigm |
| 10 |
defines standard locations for your own data files that will override BRLTTY's |
| 11 |
provided data files. In other words, you no longer need to modify BRLTTY's |
| 12 |
provided data files in order to make your own local customizations. |
| 13 |
|
| 14 |
The following data files are covered by this feature: |
| 15 |
|
| 16 |
* The configuration file (``brltty.conf``). |
| 17 |
* Text tables (``*.ttb``) and subtables (``*.tti``). |
| 18 |
See |README.TextTables| for details. |
| 19 |
* Attributes tables (``*.atb``) and subtables (``*.ati``). |
| 20 |
See |README.AttributesTables| for details. |
| 21 |
* Contraction tables (``*.ctb``) and subtables (``*.cti``). |
| 22 |
See |README.ContractionTables| for details. |
| 23 |
* Key tables (``*.ktb``) and subtables (``*.kti``). |
| 24 |
See |README.KeyTables| for details. |
| 25 |
|
| 26 |
The standard directory where you should put your customized files is |
| 27 |
``/etc/xdg/brltty/``. |
| 28 |
|
| 29 |
The simplest way to customize a provided data file is to copy it to this |
| 30 |
directory, and then to modify your copy as needed. You can, however, just place |
| 31 |
your changes in your version of the file, and then ``include`` the provided |
| 32 |
file in order to automatically always pick up the latest versions of all the |
| 33 |
unchanged lines. |
| 34 |
|
| 35 |
For example: Let's say that you'd like to add your own key bindings to the |
| 36 |
``laptop`` keyboard table. To do so, create ``/etc/xdg/brltty/laptop.ktb``, |
| 37 |
and place lines like these into it:: |
| 38 |
|
| 39 |
bind Key1 COMMAND1 |
| 40 |
bind Key2 COMMAND2 |
| 41 |
... |
| 42 |
include laptop.ktb |
| 43 |
|
| 44 |
The ``XDG_CONFIG_HOME`` environment variable defines the base directory in |
| 45 |
which to check before the standard directory is checked. If it's set and not |
| 46 |
empty then the primary override directory is ``$XDG_CONFIG_HOME/brltty/``. If |
| 47 |
it either isn't set or is empty, but the ``HOME`` environment variable is set |
| 48 |
and not empty (the usual case when you're logged in) then the primary override |
| 49 |
directory is ``$HOME/.config/brltty/``. If both the ``XDG_CONFIG_HOME`` and |
| 50 |
``HOME`` environment variables are either not set or empty (the usual case |
| 51 |
during the system boot sequence) then the primary override directory isn't |
| 52 |
defined. |
| 53 |
|
| 54 |
The ``XDG_CONFIG_DIRS`` environment variable defines a colon-separated list of |
| 55 |
secondary base directories. The ``brltty/`` subdirectory of each of these |
| 56 |
secondary base directories is BRLTTY's corresponding secondary override |
| 57 |
directory. So, for example, if ``XDG_CONFIG_DIRS`` is set to ``/a:/b`` then |
| 58 |
BRLTTY will check ``/a/brltty/`` and ``/b/brltty/`` (in that order). If |
| 59 |
``XDG_CONFIG_DIRS`` is set and not empty then ``/etc/xdg/brltty/`` is no longer |
| 60 |
implicitly checked. |
| 61 |
|
| 62 |
For backward compatibility, the original data file override paradigm is also |
| 63 |
supported. If the ``HOME`` environment variable is set and not empty then the |
| 64 |
tertiary override directory is ``$HOME/.brltty/``. If it isn't set, or if it's |
| 65 |
empty, then the tertiary override directory is ``./.brltty/``. |