The .lircrc file assigns software actions to remote-control button-push events, for example: 'Play' button detected -> Send 'Play' event to MythTV, Xine, Mplayer, VLC 'Power' button detected -> Run a script to power on/off external devices 'Vol+' button detected -> Either send 'Vol+' event to programs, or change the volume on an external device begin prog = ... remote = ... button = ... repeat = ... delay = ... config = ... mode = ... flags = ... end Each program has a specific list of 'config's, or events, that can be triggered from LIRC. Each remote has a specific list of buttons which can be detected by LIRC. The .lircrc maps the buttons to program events. ExamplesThe .lircrc file is usually saved in the home directory of your user account. Example: /home/mythtv/.lircrc . Example: Configuring 2 buttons for MythTV Note, since "remote =" was not specified, any remote with a 'DOWN' button can be used to trigger MythTV's 'Down' event: begin prog = mythtv button = DOWN repeat = 3 config = Down end
begin prog = mythtv button = LEFT repeat = 3 config = Left end
Example: Triggering Your Own ScriptsLIRC's 'irexec' program will run whatever command you specify in the 'config' line for any particular remote button. To test this, save the .lircrc and run 'irexec'. begin prog = irexec button = ok config = echo "You just pressed 'OK'!" end Example: Power On/Off Script with .lircrcIn .lircrc: begin prog = irexec button = power config = /home/mythtv/my_power_script.sh end Assuming: - A receiver named 'denon' is on emitter #3
- A TV named 'samsung' is on emitter #4
- If set-top boxes were on emitters #1 and #2 they will be left on for recording
In /home/mythtv/my_power_script.sh: For CommandIR Mini | For CommandIR II | irsend set_transmitters 3 irsend send_once denon power irsend set_transmitters 4 irsend send_once samsung power | irsend send_once commandir settransmitters-3 irsend send_once denon power irsend send_once commandir settransmitters-4 irsend send_once samsung power | Example: Change Volume on an External DeviceRemove any other stanzas in your .lircrc that assign program actions to your 'vol+' and 'vol-' buttons, then add: begin prog = irexec button = vol+ config = /home/mythtv/change_volume.sh vol+ end begin prog = irexec button = vol- config = /home/mythtv/change_volume.sh vol- end
Assuming: - A receiver named 'denon' is on emitter #3
In /home/mythtv/change_volume.sh: For CommandIR Mini | For CommandIR II | irsend set_transmitters 3 irsend send_once denon $1 | irsend send_once commandir settransmitters-3 irsend send_once denon $1 |
Make this Easier with LIRC ConfigClearly it can be alot of work to configure every remote for every program so we created LIRC Config, an online LIRC configuration tool that makes lircrc's from your lircd.conf's and program selections.
|