LIRCMD(8)

πŸ“¦
version 0.10.2 Β· 3 versions
, in alpine 3.24, debian trixie, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– LIRCMD β€” bestie edition πŸ’–

okay so this is the <pink>lircmd</pink> manual page, from the System Administration Utilities corner of the world, and honestly? she's iconic. she translates infrared signals into mouse events. no cap. πŸ¦‹


✨ NAME ✨

lircmd β€” translate infrared signals into mouse events. that's it. that's the whole vibe. πŸ’…


🌸 SYNOPSIS 🌸

lircmd [options] [config-file]

πŸŽ€ DESCRIPTION πŸŽ€

okay so bestie, picture this: lircmd reads decoded buttonpress events from a lircd(8) output socket and converts them into mouse events. those events then get made available either on the lircmd output socket (by default /var/run/lirc/lircmd) or β€” and this is the glow-up β€” using the --uinput option, on a /dev/input device like /dev/input/event12.

this daemon can simulate a MouseSystems, IntelliMouse or IMPS/2 type mouse. and the way it works depends on a config file, which by default lives at /etc/lirc/lircmd.conf. that file is the main character fr β€” it determines which button from which remote causes a mouse move or a mouse button click. you can also define a special button that activates or deactivates the mouse mode. so many options, so much power. πŸ‘‘

the normal usage is to configure X11 to use the events produced by lircmd as an input source. go look at SEE ALSO for that. iykyk. ✨

now, using the --uinput option, the user device created by the kernel has a dynamic name which typically changes after a reboot. annoying? yes. but the lirc distribution contains a udev rule which, if installed, creates a fixed link named /dev/lircmd which always can be used. slay. 🫢

by default, using the --uinput option requires lircmd to run as root since the /dev/uinput device can be accessed only by root. but bestie, don't panic β€” the lirc distribution contains example udev rules and lircd-setup(8) configurations which can be used to make the device accessible by other users. in this way, lircmd can be run as a regular user. we love to see it. πŸ’œ


πŸ’… OPTIONS πŸ’…

  • -h, --help β€” display help message. bless. πŸ™
  • -v, --version β€” display version.
  • -n, --nodaemon β€” don't fork to background. stay present. main character energy. ✨
  • -s, --socket <socket path> β€” use an alternate lircd socket path (this is the lircmd input source, fyi). defaults to the output key in the [lircd] section of the lirc_options.conf config file, falling back to /var/run/lirc/lircd.
  • -O, --options-file=file β€” alternative default options file, usually defaults to /etc/lirc/lirc_options.conf.
  • -u, --uinput β€” on Linux systems the --uinput option will enable automatic generation of Linux input events. lircmd will open /dev/input/uinput and inject the simulated mouse events into the Linux kernel rather than creating the /dev/lircm device. the kernel makes these events available to other applications on a /dev/input device, just like any other kernel input device. that's the whole point, bestie. πŸ”₯
  • -D, --loglevel=[level] β€” determine the amount of logging information. [level] can be a symbolic syslog level: 'error', 'warning', 'info', 'notice' or 'debug'. lircd also defines three additional levels 'trace', 'trace1' and 'trace2' which gives even more messages ('trace2' bringing the most). however, in the log these messages are marked as 'debug'. spicy detail, keep it. 🌢️

πŸ”Œ SOCKET PROTOCOL πŸ”Œ

so the socket protocol contains undocumented parts. yes, really. the data on the output socket is:

MouseSystems 🐭

5 byte packets:

  • Byte 1: Button information.
  • Byte 2: X-axis change.
  • Byte 3: Y-axis change.
  • Byte 4 and 5: 0.

IMPS/2 🐭

4 byte packets. please refer to the lircmd source code for details. (yes, that's the actual instruction, bestie. go read the source. πŸ’€)

IntelliMouse 🐭

4 byte packets. please refer to the lircmd source code for details. same energy, different mouse. πŸ™ˆ


πŸ“ FILES πŸ“

lircmd will use syslogd to output error messages. it depends on your system configuration where they will show up. so like… they're out there somewhere. ✨

the options file is by default /etc/lirc/lirc_options.conf; lircmd handles the values under the [lircmd] section in this file. the location can be changed using the -O/--options-file command-line option or using the environment variable LIRC_OPTIONS_PATH. the values here are used as defaults for any option not present on command line. defaults-on-defaults, we love a layered situation. πŸ’œ


🌈 DAEMONS 🌈

lircmd is a daemon. she's built different. she should be started in some system-dependent init script. besides the systemd setup which is installed by default there are also example scripts for other distros and init systems in the contrib directory. and important: lircmd has to be started after lircd as it connects to the socket lircd provides. order matters, bestie. don't come for me. 😀


πŸ’€ BUGS πŸ’€

since the device name used when registrating the --uinput device is fixed, only one instance of lircmd using this option can run on a given system. that's a real one, no cap.

the socket protocol is a documentation-wise mess. iconic honesty tbh. 😭


πŸ‘‘ SEE ALSO πŸ‘‘


okay that's the whole page bestie, every single detail kept, nothing skipped, and you're now officially the lircmd expert. periodt. πŸ’–βœ¨

this has been lircmd version 0.10.2, last change Aug 2016 β€” love u, bye πŸŽ€πŸ’œ