AaronErhardt / tuxedo-rs

Rust libraries for interacting with hardware from TUXEDO Computers
GNU General Public License v2.0
125 stars 9 forks source link
Tuxedo-rs Tuxedo-rs

Tuxedo-rs 🐧+🦀=❤️

Rust libraries for interacting with hardware from TUXEDO Computers.

Tuxedo-rs is a community project. It is not developed nor supported by TUXEDO Computers.
Although we only supports TUXEDO hardware for now, other vendors are free to contribute their own bindings.

Motivation

The TUXEDO Control Center (TCC) is a neat application that allows you to control different parts of your hardware, such as fans, webcam and performance profiles. However, TCC and its tccd service rely on Node.js which makes it slow, memory hungry and hard to package.

Also, tuxedo-rs is modular and contains several crates with different levels of abstraction, which makes it easy for everyone to built their own tools on top.

Why Rust?

Structure

Project structure Project structure

Tested hardware

This list includes devices that were successfully tested with tuxedo-rs. Since I have limited access to hardware, please consider adding your device(s) to the list.

To find out more about the features supported by your device, you can install the tailor_hwcaps CLI-tool:

cargo install tailor_hwcaps --git https://github.com/AaronErhardt/tuxedo-rs && tailor_hwcaps

Installation

Packaging status

Currently, tuxedo-rs isn't available from other package archives so you have to install it from source.

Tuxedo driver modules

If you use a distribution that doesn't package the required tuxedo hardware drivers, you can install the from source.

git clone https://github.com/tuxedocomputers/tuxedo-keyboard.git
cd tuxedo-keyboard
git checkout release
sudo make dkmsinstall

Tailord

Tailord is the system service that runs in the background and interacts with the driver modules. It exposes a D-BUS interface that can be used by applications to configure the hardware.

cd tailord
meson setup --prefix=/usr _build
ninja -C _build
ninja -C _build install

If you have the TUXEDO Control Center (TCC) and its daemons installed, make sure to deactivate them first.

sudo systemctl disable tccd.service 
sudo systemctl stop tccd.service 
sudo systemctl disable tccd-sleep.service 
sudo systemctl stop tccd-sleep.service 

Then, enable tailord with the following commands:

sudo systemctl enable tailord.service 
sudo systemctl start tailord.service 

Tailor GUI

Tailor GUI will soon be available as flatpak package. In the meantime, you can build the app from source. Usually, building the app only requires GNOME Builder or the flatpak extension for VSCode. Yet, you can use the command line if your prefer it:

flatpak install org.gnome.Sdk//44 org.freedesktop.Sdk.Extension.rust-stable//22.08 org.gnome.Platform//44 runtime/org.freedesktop.Sdk.Extension.llvm15//22.08
flatpak-builder --user flatpak_app tailor_gui/build-aux/com.github.aaronerhardt.Tailor.json 
flatpak-builder --run flatpak_app tailor_gui/build-aux/com.github.aaronerhardt.Tailor.json tailor_gui

If you don't want to use flatpak-builder, make sure you have the following dependencies installed on your system.

Ubuntu 23.04:

sudo apt install meson libadwaita-1-dev libgtk-4-dev

Arch Linux:

sudo pacman -S meson libadwaita gtk4

Fedora 38:

sudo dnf -y install meson libadwaita-devel gtk4-devel

Then build and install Tailor GUI with meson:

cd tailor_gui
meson setup --prefix=/usr _build
ninja -C _build
ninja -C _build install

Tailor CLI

You can build and install the tailor CLI from source using cargo:

cargo install --path tailor_cli
tailor --help

NixOS

tuxedo-rs can be enabled on NixOS with the following options:

{
  hardware.tuxedo-rs = {
    enable = true;
    tailor-gui.enable = true;
  };
}

Roadmap