Perl LIRC Client (plircc)


Perl LIRC Client, plircc, is a replacement of irexec and irxevent found in the standard LIRC distribution. Matty Airas decided to write it since he found it difficult to create clean and nice configuration files for irexec/irxevent. He also did not like the idea of having two separate clients doing the same logical thing. Since the source code of irexec/irxevent was completely uncommented, He felt it would be easier to do a complete rewrite than trying to figure out the C code.

Unfortunatly, Matty didn't advertise much on its great app and actually seams to have stopped development. I've (Pierre Tardy) added some nice functionnalities for my own uses and hope this may help someone.

plircc implements a modified stack automaton to keep track of the remote control state.

plircc was developed using Hauppauge LIRC drivers and pinnacle PCTV drivers, but it should work on any LIRC-compliant remote. That is one of the things I would like feedback on, though.

plircc has now osd support, you can display many thing on the screen for instant user feedback.

plircc also tries and monitor the processes to automatically jump to good state when the user launch an application supported by the configuration file.


The installation process is quite manual, but hopefully straightforward.

  1. Get and uncompress the plircc package: plircc-0.1.tar.gz.
  2. Uncompress and install the X11::Protocol perl module. Then change to the directory and say:

    perl Makefile.PL
    make install

  3. Copy the configuration file dot-plircc to ~/.plircc.
  4. Copy the program itself, plircc to a place of your liking, eg. /usr/local/bin or ~/bin.
  5. Kill the existing clients: killall irexec irxevent.
  6. Run plircc: plircc (note that the configuration file very probably will not conform to your environment, so you have to edit it). The program supports arguments -D for debugging output and -c for defining configuration file on command-line.


plircc basically implements a modified state automaton, and the configuration file defines the automaton states that the software will use. plircc does not use liblirc for its configuration so the file ~/.lircrc becomes obsolete if you use plircc. For the format of the configuration file, see dot-plircc. Each new state begins with the name of the state in the beginning of a new line, suffixed by a colon. The state transitions are written on adjacent lines, with newlines separating different transitions. The transition keywords are as follows:

The name of the key as defined by lirc. The key may be appended with an optional repeat rate field (1 equals to fastest possible repeat, any number greater than that slows the repeat by respective amount).
The action to be taken. Currently, it may be either exec (execute a command) or key (send a keypress to a window). If the command is launched by the user manually, then a process event will match and plircc will perform the transition. This is usefull to automatically jump to a given state when some specific app is launched, ie if the user opens mplayer by clicking on a video, and there is a transition that would have launched mplayer and go to the MPLAYER state, plircc will automatically sump to MPLAYER state
Push the argument to the stack. If the argument is _STATE_, the name of the current state is pushed.
Pop a matching item from the stack. If the argument is _POP_, any item is popped (and the item may be used in the corresponding go statement).
Assert that the process given in argument is still running. If not, the transition would match, This is basically to exit a give mode when the user manually quit the application
Switch to a new state. If the argument is _POP_, the name of the new state is taken from the stack with a corresponding pop statement.
Display the given string on screen using xosd
give a title to this transition that will be displayed in display_sum command. Use it if you already have a visual feedback for your command, but still want your keystroke to be displayed in the summary
Display a volume slider. The argument is a shell command use aumix to get the OSS mixer values. You can also use this command to display a seek slider.
Display the summary of the commands available. Use the display and title line of each transition available on this mode to display, what the user can do with its remote command in this mode. The summarry is automativaly displayed at each mode change. Think about it as a remainder, when your conf file become so big that it become to hard to remember all..

Two special states exists: START and GLOBAL. START is the state in which the automaton begins and to which it (hopefully) falls back in state of an error. The transitions of the GLOBAL state are parsed always after the current state, so it is useful for creating default transitions.

If you make changes to the configuration file, you may ask the running process to re-read the configuration by saying killall -HUP plircc (note that this is very erratic at the moment).


Oh, yes please!



Thanks to:


This program is licensed under the General Public License (GPL) version 2. See the file LICENSE in the distribution for details.

If the GPL is problematic for your purposes, I may be willing to change the license for you.


plircc is (C) Matti Airas and Pierre Tardy, 1999-2004. All rights reserved.

Matti Airas
Pierre Tardy

[Home page]

Last modified: Sun Oct 31 23:23:23 EEST 2004