💡 Automatically turn your Logitech Litra device on when your webcam turns on, and off when your webcam turns off (macOS and Linux only)
The following Logitech Litra devices, connected via USB, are supported:
macOS or Linux via Homebrew
- Install the latest version of
litra-autotoggleby runningbrew tap timrogers/tap && brew install litra-autotoggle. - Run
litra-autotoggle --helpto check that everything is working.
macOS or Linux via Cargo, Rust's package manager
- Install Rust on your machine, if it isn't already installed.
- Install the
litra-autotogglecrate by runningcargo install litra-autotoggle. - Run
litra-autotoggle --helpto check that everything is working and see the available commands.
- Download the latest release for your platform. macOS and Linux devices are supported.
- Add the binary to
$PATH, so you can execute it from your shell. For the best experience, call itlitra-autotoggle. - Run
litra-autotoggle --helpto check that everything is working.
In the background, using Homebrew Services (Homebrew installations only)
Run brew services start timrogers/tap/litra-autotoggle.
litra-autotoggle will run in the background, and all connected Litra devices will turn on when your webcam turns on, and off when your webcam turns off. If no Litra device is connected, the listener will keep on running, but will do nothing.
To customize the background service's configuration, edit the config file at $(brew --prefix)/etc/litra-autotoggle.yml. For information on how litra-autotoggle config files work, see "Using a configuration file" below. To validate your config file, run litra-autotoggle --config-file $(brew --prefix)/etc/litra-autotoggle.yml.
Note
When starting the service for the first time on a macOS device, you will receive a notification warning you about software running in the background.
Just run litra-autotoggle. By default, all connected Litra devices will turn on when your webcam turns on, and off when your webcam turns off.
The following arguments are supported:
--config-fileto specify a YAML configuration file containing options (see "Using a configuration file" below)--serial-numberto point to a specific Litra device by serial number. You can get the serial number using thelitra devicescommand in thelitraCLI.--device-pathto point to a specific Litra device by its path (useful for devices that don't show a serial number).--device-typeto point to a specific Litra device type (glow,beamorbeam_lx).--require-deviceto enforce that a Litra device must be connected. By default, the listener will keep running even if no Litra device is found. With this set, the listener will exit whenever it looks for a Litra device and none is found.--video-device(Linux only) to watch a specific video device (e.g./dev/video0). By default, all video devices will be watched.--delayto customize the delay (in milliseconds) between a webcam event being detected and toggling your Litra. When your webcam turns on or off, multiple events may be generated in quick succession. Setting a delay allows the program to wait for all events before taking action, avoiding flickering. Defaults to 1.5 seconds (1500 milliseconds).
Note
Only one filter (--serial-number, --device-path, or --device-type) can be specified at a time.
Instead of passing arguments on the command line, you can use a YAML configuration file with the --config-file option. This is particularly useful when running litra-autotoggle as a background service.
Create a YAML file (e.g., config.yml) with your desired options:
# Target a specific device type
device_type: "glow"
# Enable verbose logging
verbose: true
# Set a custom delay
delay: 2000
# Require a device to be present
require_device: true
# Linux only: specify video device
# video_device: "/dev/video0"Then run:
litra-autotoggle --config-file config.ymlAvailable configuration options:
All command-line options can be specified in the configuration file using underscored names:
serial_number(string)device_path(string)device_type(string:glow,beam, orbeam_lx)require_device(boolean)video_device(string, Linux only)delay(number, in milliseconds)verbose(boolean)
Important notes:
- Command-line arguments take precedence over configuration file values
- The configuration file is strictly validated - unknown fields or invalid values will cause an error
- Only one filter (
serial_number,device_path, ordevice_type) can be specified in the config file - See
example-config.ymlfor a complete example with all available options
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