Skip to content

gregdel/scbat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

scbat

Minimal Steam Controller 2 / puck battery reader for Linux.

Scans /dev for matching Valve hidraw devices and prints the first battery report received:

hidrawX level_percent

Example:

hidraw7 83

Download

The latest release provides statically linked Linux binaries for x86-64 and ARM64. Check your architecture with uname -m, then download the matching files.

For x86-64 (x86_64):

curl -fLO https://github.com/gregdel/scbat/releases/latest/download/scbat_linux_amd64
curl -fLO https://github.com/gregdel/scbat/releases/latest/download/scbat_linux_amd64.sha256sum
sha256sum -c scbat_linux_amd64.sha256sum
install -Dm755 scbat_linux_amd64 ~/.local/bin/scbat

For ARM64 (aarch64 or arm64):

curl -fLO https://github.com/gregdel/scbat/releases/latest/download/scbat_linux_arm64
curl -fLO https://github.com/gregdel/scbat/releases/latest/download/scbat_linux_arm64.sha256sum
sha256sum -c scbat_linux_arm64.sha256sum
install -Dm755 scbat_linux_arm64 ~/.local/bin/scbat

Each push to master creates a release named with its UTC build time and marks it as the latest release.

Build

make

The Makefile uses Zig's C compiler to produce a stripped, statically linked x86-64 Linux binary named scbat by default. Set TARGET to another Zig target to cross-compile for a different architecture. For example, build an ARM64 Linux binary without replacing the default output:

make TARGET=aarch64-linux-musl OUTPUT=scbat-arm64

Run

./scbat

For a WM bar:

scbat | cut -d' ' -f2

Non-root access

On Arch Linux, install the steam-devices package to grant logged-in users access to Valve HID devices:

sudo pacman -S steam-devices

Reconnect the controller or puck after installing the package.

When no supported device or battery report is available, scbat prints nothing and exits with status 1.

About

Steam Controller 2 battery level

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors