12 stable releases
new 2.2.0 | Nov 3, 2024 |
---|---|
2.1.0 | Oct 11, 2024 |
1.6.0 | Oct 3, 2024 |
1.3.0 | Aug 8, 2024 |
0.3.0 | Feb 12, 2024 |
#258 in Hardware support
804 downloads per month
Used in litra-autotoggle
41KB
825 lines
litra-rs
💡 Control your Logitech Litra light from the command line
Features
With this tool, you can:
- Turn your light on and off
- Check if the light is on or off
- Set, get, increase and decrease the brightness of your light
- Set, get, increase and decrease the temperature of your light
[!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
- Install the latest version by running
brew tap timrogers/tap && brew install litra
. - Run
litra --help
to check that everything is working and see the available commands.
macOS, Linux or Windows via Cargo, Rust's package manager
- Install Rust on your machine, if it isn't already installed.
- Install the
litra
crate by runningcargo install litra
. - Run
litra --help
to check that everything is working and see the available commands.
macOS, Linux or Windows via direct binary download
- Download the latest release for your platform. macOS, Linux and Windows devices are supported.
- Add the binary to
$PATH
, so you can execute it from your shell. For the best experience, call itlitra
on macOS and Linux, andlitra.exe
on Windows. - 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:
litra on
: Turn your Logitech Litra device onlitra off
: Turn your Logitech Litra device offlitra toggle
: Toggles your Logitech Litra device on or offlitra brightness
: Sets the brightness of your Logitech Litra device, using either--value
(measured in lumens) or--percentage
(as a percentage of the device's maximum brightness). The brightness can be set to any value between the minimum and maximum for the device returned by thedevices
command.litra brightness-up
: Increases the brightness of your Logitech Litra device, using either--value
(measured in lumens) or--percentage
(with a number of percentage points to add to the device's brightness)litra brightness-down
: Decreases the brightness of your Logitech Litra device, using either--value
(measured in lumens) or--percentage
(with a number of percentage points to subtract from the device's brightness)litra temperature
: Sets the temperature of your Logitech Litra device, using a--value
measured in kelvin (K). The temperature be set to any multiple of 100 between the minimum and maximum for the device returned by thedevices
command.litra temperature-up
: Increases the temperature of your Logitech Litra device, using a--value
measured in kelvin (K). The value must be a multiple of 100.litra temperature-down
: Decreases the temperature of your Logitech Litra device, using a--value
measured in kelvin (K). The value must be a multiple of 100.
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:
litra devices
: List Logitech Litra devices connected to your computer. This will be returned in human-readable format by default, or you can get JSON output with the--json
flag.
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
.
Dependencies
~0.4–11MB
~67K SLoC