Section: Misc. Reference Manual Pages (1)
Updated: Aug 2015
lirc-config-tool - tool to scan and generate lirc config files
lirc-config-tool -s|-u [ -c FILE]
lirc-config-tool [-o DIR] [-d] [-c FILE] [FILES]
Without options, generates all available application specific lircrc files in ~/.config/lirc. The optional [files] is a list of files to build or dump, as listed by -l.
The script is designed to assist in the setup of the lirc(8) configuration files for ordinary remote controls. It is not aimed to handle full-blown keyboards or joystick devices. The generated lircrc files represents a starting point which will need further, manual refinements but might "work" in a basic sense in many cases.
The setup involves normalizing the lircd.conf to use symbols in the legal namespace, and to create application specific lircrc files which uses the normalized symbols.
To assist normalizing /usr/local/etc/lircd.conf, the script can report symbols used which not are in the namespace. It can can also update many of these symbols to corresponding symbols within the namespace.
The script also can create application specific lircrc files such as mythtv.lircrc or vlc.lircrc. It then uses the normalized key symbols in /usr/local/etc/lirdc.conf. By default, files are created in ~/.config/lirc.
Generated lircrc files basically combines known keys from /usr/local/etc/lirc/lircd.conf with template data for an application. The process results in a lircrc file, a list a of unused keys and some entries which don't match any existing key. The unused keys and unmatched entries are written as comments into the generated file.
An 'illegal' key i. e., a key not in namespace, will not match any entry and will thus always be unused. However, it's perfectly possible to use it later on while manually modifying the lircrc files.
When updating files, script always makes backup copies.
The generated lircrc files are intended to be included in a main ~/.config/lircrc file. A minimal such might look like
Scan /usr/local/etc/lirc/lircd.conf for duplicated symbols and symbols not in namespace:
Update a local lircd.conf file to use symbols in namespace:
List available files to generate:
Generate one of the files listed by -l, creates ~/.config/lirc/mythtv.lircrc:
Dump template data for mythtv:
Use possibly edited data to create a modified mythtv.lircrc in current dir:
The -s option simply reports all key symbols not in namespace. It also reports some symbols which although legal are inappropriate in this context, notably KEY_NUMERIC_0..KEY_NUMERIC_9. If present, duplicated keys are also reported.
The -u option converts several known symbols to their corresponding KEY_* symbols. Symbols which have names like KEY_WINDOWS but not are in namespace gets a X_ prefix e. g., KEY_WINDOWS -> X_KEY_WINDOWS. The converted file thus guarantees that any key symbol starting with KEY_ is a legal symbol.
All known numeric keys such as '1', 'KEY_1', 'KEY_KP_1', 'KEY_NUMERIC_1 are converted to KEY_1.
All modifications are marked by comments in file.
The script can be extended to support more applications by providing a shell function named *.lircdata. E. g., to add a new application named "my_app" based on the built-in vlc application:
$ lirc-config-tool -d vlc >my_app.lircdata
$ function my_app_lircdata()
> cat my_app.lircdata
$ export -f my_app_lircdata
$ lirc-config-tool my_app
The script uses a simple, line-oriented format to represent the lircrc files. The purpose of the format is to be compact and thus to give a good overview, and also to be easy to parse. Each line is divided in comma-separated tokens. There are four kind of lines.
Comment lines begins with a '#'. These are copied verbatim to the output file.
The first data line represents global items, applicable to all entrys. The first word is the program name. It's used in the first 'program=' line. Following words, if present, are optional lines which will be appended to each entry in the file.
A data line starting with 'begin' or 'end' is a mode block designator. It's copied verbatim to output file.
All other data lines represents a button/config entry. The format is
<button> <config> [extra]...
The button value is used in the button = line, and the config item is used in the config = line. Both are mandatory. Following items, if any, are copied as verbatim lines to the entry.
An unlikely example: The data format
myprog, flags = quit
KEY_VOLUMEUP, volume-up, delay=4, repeat=1
program = myprog
button = KEY_VOLUME_UP
config = volume-up
delay = 4
repeat = 1
flags = quit
program = myprog
button = KEY_VOLUME_DOWN
config = volume-down
flags = quit
License GPLv2+: GNU GPL version 2 or later <http://gnu.org/licenses/gpl.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.
http://www.lirc.org/ - Main lirc documentation
This document was created by
using the manual pages.
Time: 19:29:43 GMT, August 09, 2016