A FOSS replacement for nano leafs proprietary "PC Screen Mirror Lightstrip" software.
Platform Support: Windows Linux.
nlctld— system daemon that holds the HID device open and runs the current animationnlctl— CLI tool that sends commands to the daemon over a Unix socket
State is persisted to /var/lib/nlctl/state.json, so the last-set mode is automatically restored after a reboot.
# Build nlctl
$ cargo build --release
# Create the system user
$ sudo useradd -r -s /sbin/nologin -M nlctl
# Set up the udev rule
$ echo 'SUBSYSTEM=="hidraw", ATTRS{idVendor}=="37fa", ATTRS{idProduct}=="8202", GROUP="nlctl", MODE="0660"' \
| sudo tee /etc/udev/rules.d/99-nanoleaf.rules
$ sudo udevadm control --reload && sudo udevadm trigger
# Install binaries
$ sudo cp target/release/nlctld target/release/nlctl /usr/local/bin/
# Install and enable the systemd service
$ sudo cp nlctld.service /etc/systemd/system/
$ sudo systemctl daemon-reload
$ sudo systemctl enable --now nlctldThe daemon starts immediately and will start automatically on every boot.
$ nlctl rainbow
$ nlctl solid --color 255,0,128
$ nlctl breathing --color 0,100,255
$ nlctl wave --color 255,50,0
$ nlctl reactive # syncs LEDs to screen content
$ nlctl off
$ nlctl statusReactive mode captures the screen via X11 and sets each LED zone to the average color of the corresponding screen edge.
nlctl forwards your $DISPLAY and $XAUTHORITY automatically through nlctl reactive.
No extra configuration is needed as long as you run the command from within your desktop session.
No wayland support. Very doable, I just don't use it.
The strip wraps around the monitor. Zone counts default to 10,10,10,10 (bottom, left, top, right) and can be tuned:
nlctl reactive --zones 12,8,12,8This project is available under the MIT license. See the LICENSE file for details.