distribution/packages/sysutils/eventlircd/udev.d/98-eventlircd.rules
2022-02-05 09:23:32 -05:00

240 lines
9.4 KiB
Text

################################################################################
# An example udev rules file for eventlircd.
#
# This rules file does not start eventlircd. Many applications only check for
# the lircd socket at application lauch. Therefore, it is better to start
# eventlircd in an init script so that eventlircd creates the lircd socket
# before any applications that use LIRC launch.
################################################################################
# eventlircd only does something for "add" and "remove" actions.
ACTION!="add|remove", GOTO="end"
# eventlircd only does something "input" subsystem devices.
SUBSYSTEM!="input", GOTO="end"
# eventlircd can only handle event devices.
KERNEL!="event[0-9]*", GOTO="end"
# eventlircd ignores devices created by eventlircd.
ATTRS{name}=="eventlircd", GOTO="end"
#-------------------------------------------------------------------------------
# Ask eventlircd to handle input event devices created by lircd. For this to
# work, lircd must be configured to output Linux input events and must be
# configured to output key names that conform to the LIRC namespace derived from
# the Linux key/button event names. This rule assumes that lircd performs all
# key mappings, so the rule does not provide a value for "eventlircd_evmap".
# For more information on lircd, see <http://www.lirc.org/>.
#-------------------------------------------------------------------------------
ATTRS{name}=="lircd", \
ENV{eventlircd_enable}="true"
ATTRS{name}=="lircd-uinput", \
ENV{eventlircd_enable}="true"
#-------------------------------------------------------------------------------
# Ask eventlircd to handle input event devices created by bdremoteng. For this
# to work, bdremoteng must be configured to output Linux input events and must
# be configured to output key names that conform to LIRC namespace derived
# from the Linux key/button event names. For more information on bdremoteng,
# see <http://code.google.com/p/bdremote-ng/>.
#-------------------------------------------------------------------------------
ATTRS{name}=="bdremoteng", \
ENV{eventlircd_enable}="true", \
ENV{eventlircd_evmap}="bdremoteng.evmap"
#-------------------------------------------------------------------------------
# Ask eventlircd to handle input event devices created by wminput. This rule
# assumes that wminput performs all key mappings, so the rule does not provide a
# value for "eventlircd_evmap" For more information on wminput, see
# <http://abstrakraft.org/cwiid/>.
#-------------------------------------------------------------------------------
ATTRS{name}=="bdremoteng", \
ENV{eventlircd_enable}="true"
#-------------------------------------------------------------------------------
# Ask eventlircd to handle input event devices created by ir-core (kernel).
#-------------------------------------------------------------------------------
SUBSYSTEMS=="rc", \
ENV{eventlircd_enable}="true", \
ENV{eventlircd_evmap}="default.evmap"
#-------------------------------------------------------------------------------
# Ask eventlircd to handle input event devices.
#-------------------------------------------------------------------------------
# Xiaomi Mi Box USA remote
SUBSYSTEMS=="input", ATTRS{name}=="Xiaomi Remote", \
ENV{eventlircd_enable}="true", \
ENV{eventlircd_evmap}="xiaomibtremote.evmap"
# Xiaomi Mi Box aftermarket remote
SUBSYSTEMS=="input", ATTRS{name}=="小米蓝牙遥控器", \
ENV{eventlircd_enable}="true", \
ENV{eventlircd_evmap}="xiaomibtremoteAM.evmap"
# iMON Ultrabay Front Panel
SUBSYSTEMS=="input", ATTRS{name}=="iMON Panel, Knob and Mouse(15c2:ffdc)", \
ENV{eventlircd_enable}="true", \
ENV{eventlircd_evmap}="default.evmap"
# ABOX Wireless Remote
SUBSYSTEMS=="input", ATTRS{name}=="Hotack_RC", \
ENV{eventlircd_enable}="true", \
ENV{eventlircd_evmap}="aboxwireless.evmap"
#-------------------------------------------------------------------------------
# Ask eventlircd to handle USB HID devices that show up as event devices and are
# known to be remote controls. For simplicity, the event map file names have the
# format <BUSTYPE>_<VENDOR>_<PRODUCT>.evmap.
#-------------------------------------------------------------------------------
SUBSYSTEMS=="usb", GOTO="begin-usb"
GOTO="end-usb"
LABEL="begin-usb"
ENV{ID_USB_INTERFACES}=="", IMPORT{builtin}="usb_id"
ENV{ID_VENDOR_ID}=="0bc7", ENV{ID_MODEL_ID}=="0006", \
ENV{eventlircd_enable}="true", \
ENV{eventlircd_evmap}="03_$env{ID_VENDOR_ID}_$env{ID_MODEL_ID}.evmap"
ENV{ID_VENDOR_ID}=="0419", ENV{ID_MODEL_ID}=="0001", \
ENV{eventlircd_enable}="true", \
ENV{eventlircd_evmap}="03_$env{ID_VENDOR_ID}_$env{ID_MODEL_ID}.evmap"
ENV{ID_VENDOR_ID}=="046d", ENV{ID_MODEL_ID}=="c101", \
ENV{eventlircd_enable}="true", \
ENV{eventlircd_evmap}="03_$env{ID_VENDOR_ID}_$env{ID_MODEL_ID}.evmap"
ENV{ID_VENDOR_ID}=="046e", ENV{ID_MODEL_ID}=="5577", \
ENV{eventlircd_enable}="true", \
ENV{eventlircd_evmap}="topseed.evmap"
ENV{ID_VENDOR_ID}=="046e", ENV{ID_MODEL_ID}=="5578", \
ENV{eventlircd_enable}="true", \
ENV{eventlircd_evmap}="topseed.evmap"
ENV{ID_VENDOR_ID}=="04b4", ENV{ID_MODEL_ID}=="0100", \
ENV{eventlircd_enable}="true", \
ENV{eventlircd_evmap}="cypress.evmap"
ENV{ID_VENDOR_ID}=="04b4", ENV{ID_MODEL_ID}=="0101", \
ENV{eventlircd_enable}="true", \
ENV{eventlircd_evmap}="cypress.evmap"
ENV{ID_VENDOR_ID}=="04f2", ENV{ID_MODEL_ID}=="0618", \
ENV{eventlircd_enable}="true", \
ENV{eventlircd_evmap}="topseed.evmap"
ENV{ID_VENDOR_ID}=="0766", ENV{ID_MODEL_ID}=="0204", \
ENV{eventlircd_enable}="true", \
ENV{eventlircd_evmap}="topseed.evmap"
ENV{ID_VENDOR_ID}=="1784", ENV{ID_MODEL_ID}=="0004", \
ENV{eventlircd_enable}="true", \
ENV{eventlircd_evmap}="topseed.evmap"
ENV{ID_VENDOR_ID}=="03eb", ENV{ID_MODEL_ID}=="0002", \
ENV{eventlircd_enable}="true", \
ENV{eventlircd_evmap}="03_$env{ID_VENDOR_ID}_$env{ID_MODEL_ID}.evmap"
ENV{ID_VENDOR_ID}=="05a4", ENV{ID_MODEL_ID}=="9881", \
ENV{eventlircd_enable}="true", \
ENV{eventlircd_evmap}="03_$env{ID_VENDOR_ID}_$env{ID_MODEL_ID}.evmap"
# ENV{ID_VENDOR_ID}=="05ac", ENV{ID_MODEL_ID}=="8241", \
# ENV{eventlircd_enable}="true", \
# ENV{eventlircd_evmap}="03_$env{ID_VENDOR_ID}_$env{ID_MODEL_ID}.evmap"
ENV{ID_VENDOR_ID}=="0709", ENV{ID_MODEL_ID}=="9137", \
ENV{eventlircd_enable}="true", \
ENV{eventlircd_evmap}="03_$env{ID_VENDOR_ID}_$env{ID_MODEL_ID}.evmap"
ENV{ID_VENDOR_ID}=="0755", ENV{ID_MODEL_ID}=="2626", \
ENV{eventlircd_enable}="true", \
ENV{eventlircd_evmap}="03_$env{ID_VENDOR_ID}_$env{ID_MODEL_ID}.evmap"
ENV{ID_VENDOR_ID}=="1241", ENV{ID_MODEL_ID}=="e000", \
ENV{eventlircd_enable}="true", \
ENV{eventlircd_evmap}="03_$env{ID_VENDOR_ID}_$env{ID_MODEL_ID}.evmap"
ENV{ID_VENDOR_ID}=="13ec", ENV{ID_MODEL_ID}=="0006", \
ENV{eventlircd_enable}="true", \
ENV{eventlircd_evmap}="03_$env{ID_VENDOR_ID}_$env{ID_MODEL_ID}.evmap"
ENV{ID_VENDOR_ID}=="147a", ENV{ID_MODEL_ID}=="e02d", \
ENV{eventlircd_enable}="true", \
ENV{eventlircd_evmap}="03_$env{ID_VENDOR_ID}_$env{ID_MODEL_ID}.evmap"
ENV{ID_VENDOR_ID}=="18b1", ENV{ID_MODEL_ID}=="0037", \
ENV{eventlircd_enable}="true", \
ENV{eventlircd_evmap}="03_$env{ID_VENDOR_ID}_$env{ID_MODEL_ID}.evmap"
ENV{ID_VENDOR_ID}=="1d57", ENV{ID_MODEL_ID}=="ac01", \
ENV{eventlircd_enable}="true", \
ENV{eventlircd_evmap}="03_$env{ID_VENDOR_ID}_$env{ID_MODEL_ID}.evmap"
#ENV{ID_VENDOR_ID}=="9022", ENV{ID_MODEL_ID}=="d660", \
ATTRS{idVendor}=="9022", ATTRS{idProduct}=="d660", \
ENV{eventlircd_enable}="true", \
ENV{eventlircd_evmap}="tevii_s660.evmap"
ENV{ID_VENDOR_ID}=="0471", ENV{ID_MODEL_ID}=="0613", \
ENV{eventlircd_enable}="true", \
ENV{eventlircd_evmap}="spinelplus.evmap"
ENV{ID_VENDOR_ID}=="0471", ENV{ID_MODEL_ID}=="206c", \
ENV{eventlircd_enable}="true", \
ENV{eventlircd_evmap}="spinelplus.evmap"
ENV{ID_VENDOR_ID}=="0471", ENV{ID_MODEL_ID}=="20cc", \
ENV{eventlircd_enable}="true", \
ENV{eventlircd_evmap}="spinelplus.evmap"
ENV{ID_VENDOR_ID}=="2252", ENV{ID_MODEL_ID}=="1037", \
ENV{eventlircd_enable}="true", \
ENV{eventlircd_evmap}="osmc_rf.evmap"
ENV{ID_VENDOR_ID}=="2017", ENV{ID_MODEL_ID}=="1688", \
ENV{eventlircd_enable}="true", \
ENV{eventlircd_evmap}="osmc_rf2.evmap"
# Enable wake-on-usb for the USB remotes.
RUN+="wakeup_enable"
LABEL="end-usb"
#-------------------------------------------------------------------------------
# Ask eventlircd to handle Bluetooth HID devices that show up as event devices
# and are known to be remote controls. For simplicity, the event map file names
# have the format <BUSTYPE>_<VENDOR>_<PRODUCT>.evmap.
#-------------------------------------------------------------------------------
SUBSYSTEMS=="bluetooth", GOTO="begin-bluetooth"
GOTO="end-bluetooth"
LABEL="begin-bluetooth"
ATTRS{name}=="Nintendo Wii Remote", \
ENV{eventlircd_enable}="true", \
ENV{eventlircd_evmap}="wiimote.evmap"
ATTRS{name}=="BD Remote Control", \
ENV{eventlircd_enable}="true", \
ENV{eventlircd_evmap}="ps3remote.evmap"
#PS3 BD Remote Version 2 (Bluetooth AND infrared 3 in 1 remote)
ATTRS{name}=="Sony Computer Entertainment Inc BD Remote Control", \
ENV{eventlircd_enable}="true", \
ENV{eventlircd_evmap}="ps3remote.evmap"
# Amazon Fire TV stick remote
ATTRS{name}=="Amazon Fire TV Remote", \
ENV{eventlircd_enable}="true", \
ENV{eventlircd_evmap}="aftvsremote.evmap"
LABEL="end-bluetooth"
# tell libinput to ignore devices handled by eventlircd
ENV{eventlircd_enable}=="true", ENV{LIBINPUT_IGNORE_DEVICE}="1"
LABEL="end"