Skip to content

Rust library for interacting with Elgato Stream Deck and other stream controller hardware

License

Notifications You must be signed in to change notification settings

streamduck-org/elgato-streamdeck

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

73 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

elgato-streamdeck

Rust library for interacting with Elgato Stream Deck and other stream controller hardware. Heavily based on python-elgato-streamdeck and partially on streamdeck library for rust.

This library was made as a better designed alternative to streamdeck library for Rust. I just took code from both of the libraries and made it more pleasant to use.

udev rules for Linux

If you're using systemd on your system, you might have to install udev rules to allow connecting to devices from userspace.

You can do that by using the following command to copy this repo's included 40-streamdeck.rules file into udev/rules.d/:

cp 40-streamdeck.rules /etc/udev/rules.d/

And then reloading udev rules:

sudo udevadm control --reload-rules

Unplugging and plugging back in the device should also help.

You should also create a group called "plugdev" if it doesn't exist and add yourself to it, so you get access to the devices. You also need to restart the user session to let user group changes to kick in.

Example

use elgato_streamdeck::{new_hidapi, StreamDeck};

// Create instance of HidApi
let hid = new_hidapi();

// List devices and unsafely take first one
let (kind, serial) = StreamDeck::list_devices(&hid).remove(0);

// Connect to the device
let mut device = StreamDeck::connect(&hid, kind, &serial)
    .expect("Failed to connect");

// Print out some info from the device
println!(
    "Connected to '{}' with version '{}'",
    device.serial_number().unwrap(),
    device.firmware_version().unwrap()
);

// Set device brightness
device.set_brightness(35).unwrap();

// Use image-rs to load an image
let image = image::open("no-place-like-localhost.jpg").unwrap();

// Write it to the device
device.set_button_image(7, image).unwrap();

// Flush
if device.updated {
    device.flush().unwrap();
}

Status

  • Convenient to use API for looking up devices, connecting to them and interacting with them
  • Reading buttons with async

Supported Devices

As it stands, this library should support the following devices:

About

Rust library for interacting with Elgato Stream Deck and other stream controller hardware

Resources

License

Stars

Watchers

Forks

Languages

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy