Skip to content

tayadev/StreamdeckLinux

Repository files navigation

Streamdeck Linux

Streamdeck Linux is a project that exposes two tools, streamdeckd and sdctl. Streamdeckd is a daemon that connects to elgato streamdeck devices via USB and sdctl provides a command line interface to interact with the daemon and issue commands to the devices. Communication between the two tools is done via a Unix socket.

Streamdeckd

Usage: streamdeckd [OPTIONS]

Options: -h, --help Print help -V, --version Print version --socket Path to the socket file (default: /run/streamdeckd.sock or $XDG_RUNTIME_DIR/streamdeckd.sock) -v, --verbose Enable verbose output

sdctl

Usage: sdctl [OPTIONS]

Options: -h, --help Print help -V, --version Print version --socket Path to the socket file (default: /run/streamdeckd.sock or $XDG_RUNTIME_DIR/streamdeckd.sock)

Commands: list List all connected Streamdeck devices

info Get information about a specific device

clear Clear all images and handlers for a device

brightness Set the brightness of a device (0-100)

button image [] Set the image for a button. is a path to an image file, or when omitted, stdin is used

button on-press [...] Set the command to be executed when the button is pressed

dial on-press [...] Set the command to be executed when the dial is pressed

dial on-turn-cw [...] Set the command to be executed when the dial is turned clockwise

dial on-turn-ccw [...] Set the command to be executed when the dial is turned counterclockwise

touch image [] Set the image for a touchscreen ( is a path to an image file, or when omitted, stdin is used)

touch on-press [...] Set the command to be executed when the touchscreen is pressed

touch on-swipe [...] Set the command to be executed when the touchscreen is swiped

To make sdctl easy for scripting it should only return a exit code of 0 on success. For failure, it should return a non-zero exit code and provide a descriptive error message in stderr.

Callbacks

The callbacks will be provided with the following environment variables, including more information about the event:

  • SD_DEVICE: The serial number of the device
  • SD_BUTTON: The index of the button that was pressed
  • SD_DIAL: The index of the dial that was turned
  • SD_X: The x-coordinate of the touch event
  • SD_Y: The y-coordinate of the touch event
  • SD_X2: The end x-coordinate of a touch swipe
  • SD_Y2: The end y-coordinate of a touch swipe

Implementation Details

The project is implemented in Rust, and uses the following libraries:

  • serde: for serialization and deserialization of data
  • tokio: for asynchronous I/O and concurrency
  • clap: for command-line argument parsing
  • elgato-streamdeck: for interacting with Elgato Stream Deck devices

Since the project requires two binaries, it is structured as follows:

  • /src
    • /streamdeckd
    • /sdctl
    • [any common files]

Installation

Prerequisites

  • Rust toolchain (cargo, rustc)
  • systemd (for user services)
  • Sufficient permissions to install binaries and udev rules

Install

make install

This will:

  • Build the binaries
  • Install them to /usr/local/bin
  • Install the udev rules to /etc/udev/rules.d/40-streamdeck.rules
  • Install the systemd user service file to ~/.config/systemd/user/streamdeckd.service
  • Enable and start the streamdeckd user service (it will start automatically at login)

Uninstall

make uninstall

This will:

  • Stop and disable the user service
  • Remove the systemd user service file
  • Remove the binaries
  • Remove the udev rules

Usage (User Service)

The streamdeckd daemon is installed and managed as a systemd user service. After installation, it will start automatically at login.

You can manually control the service with:

systemctl --user status streamdeckd.service systemctl --user restart streamdeckd.service systemctl --user stop streamdeckd.service

If you want to (re-)enable the service for autostart at login:

systemctl --user enable --now streamdeckd.service

If you want to disable autostart:

systemctl --user disable --now streamdeckd.service

Notes

  • Callbacks and scripts triggered by Streamdeck events will run as the current logged-in user, preserving your environment and permissions.
  • If you have multiple users on the system, each user who wants to use Streamdeck devices should run make install in their own session to set up the user service.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published