MODE2(1)

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

πŸ’– MODE2(1) β€” like, the manual page for xmode2 bestie πŸ’–

User Commands ✨ welcome to the group chat, this is the page for xmode2, and yes it lives in section 1 of the manual, as one does πŸ’…


🌸 NAME 🌸

xmode2 β€” show the pulse/space length of infrared signals 🫢


✨ SYNOPSIS ✨

xmode2 [options]

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so the whole point of xmode2 is to check that your home-brew LIRC receiver hardware is actually, y'know, operating πŸŽ€ and to let you see the IR waveform of your remote controller without an expensive oscilloscope. very much the "debugging bestie" of the toolset. lowkey iconic. no cap.

big caveat tho!! this program will not work with hardware that decodes the signals itself β€” like, e.g. TV cards, or the Irman. i.e. it only works with LIRC_MODE_MODE2 type drivers. periodt. πŸ’€

xmode2 prints a simple graphics display of the pulse/space lengths. it accepts a few commands including time base changes; see the xmode2 -h output for the deets πŸ‘€

and if you're sitting there like "is my driver even a LIRC_MODE2 type one??" β€” lirc-lsplugins(1) is right there, it lets you check. slay.


πŸ’… OPTIONS πŸ’…

  • -h, --help β€” display usage summary πŸ₯°
  • -v, --version β€” display version 🌈
  • -d, --device=device β€” read from given device πŸ“
  • -H, --driver=driver β€” use given driver πŸ”₯
  • -m, --mode β€” enable alternative display mode ✨
  • -r, --raw β€” access device directly πŸ‘‘

πŸ‘‘ RUNNING AS ROOT πŸ‘‘

ngl, in many cases xmode2 needs to run as root to access devices that regular users can't get to. but also β€” running as root creates problems, like log files owned by root, security concerns, etc. it's giving ✨chaos✨.

so to cope with that, xmode2 by default drops root privileges after opening the input device 🫢. this support is based on root permissions being acquired using sudo(1), e.g.:

$ sudo xmode2 --driver default --device /dev/lirc0

if you're not using sudo, you can accomplish the same behaviour using the SUDO_USER environment variable, e.g.:

# SUDO_USER=$LOGNAME xmode2 --raw /dev/lirc0

and the --keep-root option will make xmode2 keep its root privileges for the complete run 😌 (yes, the whole run. main character energy.)


🌈 DRIVER LOADING 🌈

drivers are loaded dynamically, bestie. the search path used for this is determined by β€” falling priority, so top one wins πŸ†:

  • The --plugindir option.
  • The 'plugindir' entry in the [lircd] section of the lirc_options.conf file.
  • The environment variable LIRC_PLUGINDIR.
  • A hardcoded default (usually /usr/lib[64]/lirc/plugins).

πŸŽ€ FILES πŸŽ€

  • ~/.cache/xmode2.log β€” debug output. setting the XDG_CACHE_HOME environment variable relocates this file to $XDG_CACHE_HOME/mode2.log πŸ—‚οΈ

⭐ SEE ALSO ⭐

the documentation for lirc is maintained as html pages πŸ“„ they are located under html/ in the documentation directory.


and that's the whole vibe check, babe β€” this was mode2 version 0.10.2, last changed Aug 2015, and it remains, to this day, iconic πŸ’œ mwah, go debug your IR signals, you got this 🫢✨