Krolyxon
Commit 4276e2b

Branches

Refs →

budctlREADME.md

104 lines · 4.3 KB · Markdown

1# budctl
2
3Control your wireless earbuds from Linux, without the vendor app: noise control, EQ, game mode,
4touch controls, battery and more. There is a command-line tool, `budctl`, and a desktop app,
5`budctl-gui`, both built on the same library.
6
7- No telemetry and no account. budctl talks to your buds over Bluetooth, through BlueZ.
8- The settings live on the buds, so budctl works alongside the phone app.
9
10**Supported buds:** realme Buds T310. More are added as the author gets them.
11
12## Install
13
14You need Rust 1.88 or newer, BlueZ, and for the desktop app a Wayland desktop.
15
16```sh
17cargo install --path crates/budctl-cli # budctl
18cargo install --path crates/budctl-gui # budctl-gui
19cp contrib/budctl.desktop ~/.local/share/applications/
20```
21
22Pair the buds and connect them in your Bluetooth settings first.
23
24## Command line
25
26```sh
27budctl list # paired buds, and whether budctl knows them
28budctl status # battery, noise control, EQ, switches
29budctl anc off|on|transparency # noise control
30budctl anc light|medium|deep # noise cancelling, at this strength
31budctl eq # the EQ presets, and the one in use
32budctl eq deep-bass # select a preset
33budctl eq custom-4 50=+3 16000=-2 # change bands of a custom preset (dB)
34budctl game on|off # game mode (low latency)
35budctl set bass-boost|spatial|wind|dual on|off
36budctl bass 2 # bass level, -5 to +5
37budctl touch # what each tap and hold does
38budctl touch left triple-tap previous # give a gesture an action (--dry-run first, if you like)
39budctl touch cycle off anc # the modes a hold steps through
40budctl find start --yes # ring the buds (loud: take them out of your ears)
41budctl find stop
42```
43
44- `--json` prints machine-readable output for scripts and status bars (`"schema": 1`).
45- `--debug` hex-dumps every frame sent and received, on stderr.
46- `--device <MAC>` picks the buds when more than one supported pair is connected.
47
48Exit codes:
49
50| Code | Meaning |
51|---|---|
52| 0 | success |
53| 1 | usage error |
54| 2 | buds not found or not connected |
55| 3 | control channel busy |
56| 4 | the buds rejected the command or did not answer |
57
58## Desktop app
59
60`budctl-gui` has five pages:
61
62- **Overview:** battery, noise control, the switches.
63- **Equalizer:** presets, the bands of your custom presets, the bass level.
64- **Gestures:** what each tap and hold does on each bud, and what a hold steps through.
65- **Earbud settings:** find my earbuds, firmware, audio codec.
66- **App settings.**
67
68The app connects when it needs to, and frees the buds' control channel 10 s after your last
69change, so other apps can use it. A change shows "Saving…" until the buds confirm it.
70
71The mouse works everywhere. Vim-like keys work on top of it (press `?` in the window):
72
73| Keys | What they do |
74|---|---|
75| `j` `k`, arrows, Tab | move the cursor |
76| `gg` `G` | first / last item |
77| `h` `l` | previous / next choice, switch off / on; `l` opens a row's page |
78| Enter, Space | toggle, step through the choices, or open |
79| `J` `K`, Ctrl+Tab, `gt` `gT` | next / previous page |
80| `1` … `5` | go to a page |
81| `r` | read the buds again |
82| Esc | hide the cursor |
83| `q` | quit |
84
85The cursor shows only after you press a key, and the first key only shows it.
86
87**Colors:** a built-in dark palette with a red accent, or a [matugen](https://github.com/InioX/matugen)
88palette: `--theme <file>`, else `~/.config/budctl/theme.json`. The file is JSON with these keys, all
89optional: `bg`, `fg`, `primary`, `primaryFg`, `primaryContainer`, `secondary`, `surfaceLow`,
90`surface`, `surfaceHigh`, `surfaceHighest`, `outlineVariant`, `surfaceVariantFg`, `err`. It is read
91again whenever the window gets focus, so a new wallpaper's colors show up there too.
92
93Other options: `--demo` shows made-up buds without Bluetooth; `--debug` and `--device` work as in
94the command-line tool.
95
96## How it works
97
98budctl speaks the buds' own control protocol over an RFCOMM socket. What is known about it, and
99how sure, is written down in [`docs/protocol/`](docs/protocol/): the
100[transport](docs/protocol/transport.md) and the [realme Buds T310](docs/protocol/realme_t310.md).
101
102## License
103
104GPL-3.0-or-later. See [LICENSE](LICENSE).