https://github.com/csmith/alphabat
Battery status for HyperX Cloud Alpha Wireless headsets
https://github.com/csmith/alphabat
Last synced: 5 months ago
JSON representation
Battery status for HyperX Cloud Alpha Wireless headsets
- Host: GitHub
- URL: https://github.com/csmith/alphabat
- Owner: csmith
- License: mit
- Created: 2022-12-17T12:14:27.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2025-06-13T21:45:11.000Z (about 1 year ago)
- Last Synced: 2025-06-13T22:35:30.827Z (about 1 year ago)
- Language: Go
- Size: 12.7 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Alphabat
Alphabat is a simple command line tool to retrieve the battery status of a
HyperX Cloud Alpha Wireless headset. (This also has the side effect of making
the headset report the correct battery level when pressing the power button.)
## Usage
```shell
CGO_ENABLED=1 go install github.com/csmith/alphabat@latest
$(go env GOPATH)/bin/alphabat
```
## Permissions and udev
In order to read and write to a USB device your user account will need
permission to access them. On Linux, you should add a udev rule along
the lines of:
```udev
SUBSYSTEMS=="usb", ATTRS{idVendor}=="03f0", ATTRS{idProduct}=="098d", TAG+="uaccess"
```
Sorting permissions out on other operating systems is left as an exercise
for the reader. (Pull requests to this README gladly accepted!)
## Exit codes
If something goes wrong, alphabat will exit with the following status codes:
| Exit code | Meaning | Possible cause |
|-----------|-------------------------|------------------------------|
| 1 | Device not found | Dongle not connected |
| 2 | Unable to open device | No permissions |
| 3 | Unable to send data | ? |
| 4 | Unable to read data | ? |
| 5 | HID library unavailable | Compiled without cgo enabled |
| 125 | No response from device | Headset not turned on |