Krolyxon
Commit b835c9b

Branches

Refs →

budctlREADME.md

105 lines · 4.4 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 dual # the phones and computers dual connection keeps
37budctl bass 2 # bass level, -5 to +5
38budctl touch # what each tap and hold does
39budctl touch left triple-tap previous # give a gesture an action (--dry-run first, if you like)
40budctl touch cycle off anc # the modes a hold steps through
41budctl find start --yes # ring the buds (loud: take them out of your ears)
42budctl find stop
43```
44
45- `--json` prints machine-readable output for scripts and status bars (`"schema": 1`).
46- `--debug` hex-dumps every frame sent and received, on stderr.
47- `--device <MAC>` picks the buds when more than one supported pair is connected.
48
49Exit codes:
50
51| Code | Meaning |
52|---|---|
53| 0 | success |
54| 1 | usage error |
55| 2 | buds not found or not connected |
56| 3 | control channel busy |
57| 4 | the buds rejected the command or did not answer |
58
59## Desktop app
60
61`budctl-gui` has five pages:
62
63- **Overview:** battery, noise control, the switches.
64- **Equalizer:** presets, the bands of your custom presets, the bass level.
65- **Gestures:** what each tap and hold does on each bud, and what a hold steps through.
66- **Earbud settings:** dual connection and the devices it keeps, find my earbuds, firmware, audio codec.
67- **App settings.**
68
69The app connects when it needs to, and frees the buds' control channel 10 s after your last
70change, so other apps can use it. A change shows "Saving…" until the buds confirm it.
71
72The mouse works everywhere. Vim-like keys work on top of it (press `?` in the window):
73
74| Keys | What they do |
75|---|---|
76| `j` `k`, arrows, Tab | move the cursor |
77| `gg` `G` | first / last item |
78| `h` `l` | previous / next choice, switch off / on; `l` opens a row's page |
79| Enter, Space | toggle, step through the choices, or open |
80| `J` `K`, Ctrl+Tab, `gt` `gT` | next / previous page |
81| `1` … `5` | go to a page |
82| `r` | read the buds again |
83| Esc | hide the cursor |
84| `q` | quit |
85
86The cursor shows only after you press a key, and the first key only shows it.
87
88**Colors:** a built-in dark palette with a red accent, or a [matugen](https://github.com/InioX/matugen)
89palette: `--theme <file>`, else `~/.config/budctl/theme.json`. The file is JSON with these keys, all
90optional: `bg`, `fg`, `primary`, `primaryFg`, `primaryContainer`, `secondary`, `surfaceLow`,
91`surface`, `surfaceHigh`, `surfaceHighest`, `outlineVariant`, `surfaceVariantFg`, `err`. It is read
92again whenever the window gets focus, so a new wallpaper's colors show up there too.
93
94Other options: `--demo` shows made-up buds without Bluetooth; `--debug` and `--device` work as in
95the command-line tool.
96
97## How it works
98
99budctl speaks the buds' own control protocol over an RFCOMM socket. What is known about it, and
100how sure, is written down in [`docs/protocol/`](docs/protocol/): the
101[transport](docs/protocol/transport.md) and the [realme Buds T310](docs/protocol/realme_t310.md).
102
103## License
104
105GPL-3.0-or-later. See [LICENSE](LICENSE).