- Python 95%
- Shell 5%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| .gitignore | ||
| autostart.py | ||
| engine.py | ||
| LICENSE | ||
| main.py | ||
| PKGBUILD | ||
| README.md | ||
nothing-ear-ui
A Qt control app (window + tray item) for Nothing Ear (2) on Linux, speaking
the reverse-engineered Nothing "NT Link" protocol directly over RFCOMM
channel 15 (the service advertised by SDP UUID
aeac4a03-dff5-498f-843a-34487cf133eb), based on the command tables from
ear-web and ear2ctl. No
proprietary app or CLI needed.
main.py Qt window + native tray item (StatusNotifierItem)
engine.py protocol + device worker (Bus, DeviceWorker)
autostart.py XDG autostart entry management
Run
python3 main.py
- Native tray item — appears in the Plasma (or any SNI) tray as soon as the app runs. The glyph follows the buds: per-bud battery bars (red ≤15%, charging dot), a dim dot when the buds are away. Menu (right/left click): ANC modes with a live checkmark, both toggles, fit test, battery line, settings, open control panel, quit.
- Launch loader — pulsing dot + "connecting…" instead of a half-alive panel; switches to the controls as soon as the first state lands (4 s safety net), shows "reconnecting…" if the buds drop mid-session.
- Battery hero — centered charge bars per component (
0xC007: id 2=left, 3=right, 4=case, 6=stereo; bit 7 = charging; red ≤15%). The case bar only appears when the buds report it — outside the case they never do. - Noise control — off / transparency / low / mid / high / adaptive with live highlight; optimistic click, reconciled by the next readback.
- In-ear detection / low-latency — real device state (
0xC00E/0xC041), shown as switches. - Ear tip fit test —
0xF054; results arrive as0xE009frames. - Settings — in-app dialog (button in the panel or the tray menu) with
an autostart toggle: writes/removes an XDG autostart entry that boots the
app with
--tray-only(tray item only, no window on login). - Close to tray — opt-in: "minimize to tray on close" in settings (off by default). Off, closing the window quits; on, closing hides the window and the app lives on as the tray item until you quit from the menu.
- Single instance — launching the app again while it's in the tray just raises the running panel and exits; never a second copy (local-socket handshake, stale sockets from crashes are cleaned up on startup).
The window owns the RFCOMM link through engine.DeviceWorker: a single
worker thread that reconnects forever, polls state, serializes every set
(followed by a readback ~350 ms later — sets are only acknowledged by the
buds), and hands updates to the UI via queued signals.
The buds are resolved at launch — EAR2_MAC env var override, otherwise the
first paired device whose name looks like "Ear (2)" / "Nothing Ear (2)"
(bluetoothctl devices Paired, no scanning). Nothing is paired? The loader
says so and keeps checking every 3 s until the pair shows up.
Protocol notes
Frame layout (little-endian):
55 60 01 | cmd u16 | len u16 | op u8 | payload… | crc16 u16, CRC-16/MODBUS
over everything before it. Direction nibble in the cmd high byte: C0 get,
F0 set, 40 answer, E0 push, 70 ack. Wire values: ANC [01 mode 00] with
mode 1=high 2=mid 3=low 4=adaptive 5=off 7=transparency; in-ear
[01 01 0|1]; latency [01]=on / [02]=off; battery payload is count
then (id, level) pairs.
Unofficial; not affiliated with Nothing Technology.
License
MIT — © Dan Tsivinsky. Blatantly based on the protocol mapping worked out by ear-web and ear2ctl.