![]() |
![]() |
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]
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 /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 /etc/lirdc.conf. By default, files are created in ~/.config/lirc.
Generated lircrc files basically combines known keys from /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 /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 -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.
$ 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
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
begin volume_mode
KEY_VOLUMEUP, volume-up, delay=4, repeat=1
KEY_VOLUMEDOWN, volume-down
end volume_mode
translates to:
begin volume_mode
begin
program = myprog
button = KEY_VOLUME_UP
config = volume-up
delay = 4
repeat = 1
flags = quit
end
begin
program = myprog
button = KEY_VOLUME_DOWN
config = volume-down
flags = quit
end
end volume_mode
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.
lircd(8)
http://www.lirc.org/ - Main lirc documentation
This document was created by
man2html,
using the manual pages.
Time: 12:25:46 GMT, March 22, 2020