lircr/README.md

36 lines
646 B
Markdown
Raw Permalink Normal View History

Description
===========
2010-04-11 18:31:00 +02:00
lircr (pronounced 'lurker') is a LIRC client library for Ruby. It is simple,
it is easy, it is fun. If you got LIRC, get lircr. I am not responsible if you
grow more hair on your index finger or thumb.
Usage
=====
require 'lirc'
lirc = LIRC::Client.new
event = lirc.next
p event
if event.name == "play"
system "xmms", "/av/music/3.mod"
end
2010-04-07 00:14:20 +02:00
Control your MPD:
require 'lirc'
2010-04-11 18:31:00 +02:00
require 'librmpd'
2010-04-07 00:14:20 +02:00
lirc = LIRC::Client.new
2010-04-11 18:31:00 +02:00
mpd = MPD.new 'localhost', 6600
2010-04-11 18:54:04 +02:00
mpd.connect
2010-04-07 00:14:20 +02:00
lirc.each do |event|
case event.name
when "play"
2010-04-11 18:31:00 +02:00
mpc.play
2010-04-07 00:14:20 +02:00
when "pause"
2010-04-11 18:31:00 +02:00
mpd.pause = !mpd.pause
2010-04-07 00:14:20 +02:00
when "stop"
2010-04-11 18:31:00 +02:00
mpd.stop
2010-04-07 00:14:20 +02:00
end
end