4 releases

0.2.1 Apr 12, 2023
0.2.0 Apr 10, 2023
0.1.1 Sep 15, 2022
0.1.0 Sep 11, 2022

#324 in Hardware support

29 downloads per month
Used in tailor_client

GPL-2.0+

7KB
168 lines

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?

  • All software should be rewritten in Rust
  • Very robust code
  • Strong compile-time guarantees
  • High performance
  • Easy to package (no additional runtime or dependencies)

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.

  • TUXEDO Aura 15 Gen1 and Gen2
  • TUXEDO Pulse 15 Gen1
  • TUXEDO Polaris 17 Gen1 AMD & Gen3
  • TUXEDO Book XP14 Gen12
  • TUXEDO InfinityBook S 14 Gen6
  • TUXEDO InfinityBook S 15 Gen6

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

  • Ioctl abstraction for tuxedo_io
  • Sysfs abstraction for tuxedo_keyboard
  • Support for hardware from both clevo and uniwill
  • Daemon with DBus interface for user space application
  • Client library for interacting with the daemon
  • CLI that interacts with the daemon
  • Native GUI that interacts with the daemon
  • OPTIONAL: Rewrite various tuxedo kernel modules in Rust

Dependencies

~0.6–1.2MB
~27K SLoC