timrogers / litra-rs

💡 Control your Logitech Litra light from the command line
MIT License
35 stars 4 forks source link
homebrew

litra-rs

💡 Control your Logitech Litra light from the command line


Features

With this tool, you can:

[!TIP] 🖲️ Want to automatically turn your Litra on and off when your webcam turns on and off? Check out litra-autotoggle!

Supported devices

The following Logitech Litra devices, connected via USB, are supported:

Installation

macOS or Linux via Homebrew

  1. Install the latest version by running brew tap timrogers/tap && brew install litra.
  2. Run litra --help to check that everything is working and see the available commands.

macOS, Linux or Windows via Cargo, Rust's package manager

  1. Install Rust on your machine, if it isn't already installed.
  2. Install the litra crate by running cargo install litra.
  3. Run litra --help to check that everything is working and see the available commands.

macOS, Linux or Windows via direct binary download

  1. Download the latest release for your platform. macOS, Linux and Windows devices are supported.
  2. Add the binary to $PATH, so you can execute it from your shell. For the best experience, call it litra on macOS and Linux, and litra.exe on Windows.
  3. Run litra --help to check that everything is working and see the available commands.

Configuring udev permissions on Linux

On most Linux operating systems, you will need to manually configure permissions using udev to allow non-root users to access and manage Litra devices.

To allow all users that are part of the video group to access the Litra devices, copy the 99-litra.rules file into /etc/udev/rules.d. Next, reboot your computer or run the following commands as root:

# udevadm control --reload-rules
# udevadm trigger

Usage

From the command line

The following commands are available for controlling your devices:

All of the these commands support a --serial-number/-s argument to specify the serial number of the device you want to target. If you only have one Litra device, you can omit this argument. If you have multiple devices, we recommend specifying it. If it isn't specified, the "first" device will be picked, but this isn't guaranteed to be stable between command runs.

The following commands are also included:

Each CLI command can also be called with --help for more detailed documentation.

From a Rust application

The litra crate includes functions for interacting with Litra devices from your Rust applications.

To see the full API, check out the documentation on Docs.rs or read through src/lib.rs.