Lircrc Gen

About

lircrc-gen is a small program written in Scheme to make writing LIRC configurations (i.e. .lircrc files) less tedious. The format of those files is quite verbose, and doesn't allow for abstraction. For example, to map all the digit buttons on your remote control, you have to spell out a block for each button:

begin
    prog = mythtv
    button = 1
    config = 1
end
begin
    prog = mythtv
    button = 2
    config = 2
end
# Imagine 8 more of these following here:
...

With lircrc-gen, you just write:

(program mythtv
  ;; Digit buttons
  (button-map (0 1 2 3 5 6 7 8 9)))

Now, (assuming you have the prerequistes] installed), you can feed that two-liner into lircrc-gen.sps, and it will spit out all ten blocks on stdout:

% ypsilon --r6rs lircrc-gen.sps < MYCONFIG.SCM
begin
    prog = mythtv
    button = 1
...

Download

lircrc-gen is part of my rotty-tools git repository.

Prerequistes

I've tested the program with Ikarus and Ypsilon. You'll additionally need the spells libraries installed. The easiest way to run get all prerequistes and run lircrc-gen.sps is probably this:

% git clone git://github.com/rotty/spe.git
% cd spe
% ./scripts/fetch-systems ypsilon
% ./scripts/launch ikarus /PATH/TO/lircrc-gen.sps < MYCONFIG.SCM