- Python 70.3%
- Shell 29.7%
|
Benoit Brummer (Trougnouf)
dca746bafe
fix: handle raw integer payloads in daemon socket handler
Prevent json.loads from parsing raw integers (like "50") into int type, which would cause TypeError when checking "volume" in payload. Now ensures payload is always a dict, converting raw integers to volume dict. Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <vibe@mistral.ai> |
||
|---|---|---|
| .gitignore | Initial commit | |
| LICENSE | Initial commit | |
| nubert-daemon@.service | feat: resilient BLE daemon with auto-reconnect and persistent socket | |
| nubert-sync@.service | feat: resilient BLE daemon with auto-reconnect and persistent socket | |
| nubert_pulseaudio_sync.sh | stop aggressively intercepting every new audio stream | |
| nubertctl.py | fix: handle raw integer payloads in daemon socket handler | |
| README.md | feat: support name (because mac address is dynamic) | |
nubertctl - Nubert Speaker Control (CLI)
An unofficial cross-platform Python utility to control Nubert speakers (X, XS, and A-Series) via Bluetooth Low Energy (BLE).
Features
- Daemon Mode: Persistent BLE connection via Unix socket for instant response times.
- PulseAudio/PipeWire Sync: Maps a virtual system volume slider to physical speaker gain.
- Auto-Protocol Detection: Supports A600, X-Series, and XS-Series hardware.
- Source & Power Control: Full control over inputs and standby states.
- Name Resolution: Identifies your speaker dynamically by its Bluetooth name, circumventing rotating MAC address problems.
Installation
Arch Linux (AUR)
Install nubertctl-git. The package includes the CLI tool, the sync script, and systemd units.
# Example using yay
yay -S nubertctl-git
Manual Installation
- Dependencies:
pip install bleak # For PulseAudio/PipeWire sync: sudo pacman -S socat # Or your distro equivalent (e.g., apt install socat)
Usage
1. Find your Speaker
nubertctl --scan
Take note of the resulting Bluetooth name (e.g., nubert X-2 2272). While a MAC address is still perfectly acceptable, using the Bluetooth Name is highly recommended.
2. Desktop Integration (Linux)
The most robust way to use this on Linux is via the provided systemd services. This creates a persistent background connection so volume changes are instant.
(If your speaker name has spaces, wrap it in a systemd-escape subshell as shown below to ensure systemctl mounts the instances perfectly!)
- Enable the Daemon:
systemctl --user enable --now nubert-daemon@$(systemd-escape "nubert X-2 2272").service - Enable the Volume Sync:
systemctl --user enable --now nubert-sync@$(systemd-escape "nubert X-2 2272").service
You will now see a "Nubert_Speaker_Remote" output in your system sound settings. Setting this as default allows your media keys to control the hardware speakers directly.
3. Manual CLI Commands
Set Volume (0-100):
nubertctl --address "nubert X-2 2272" --volume 45
Switch Source:
aux, bluetooth, xlr, coax1, coax2, optical1, optical2, usb, port.
nubertctl --address "nubert X-2 2272" --source usb
Platform Notes
- Linux: Uses
socatandpactlfor volume synchronization. - macOS: Use the UUID from
--scaninstead of a MAC address. - Windows: Pair the device in System Settings first.
Disclaimer
This is an unofficial community project. "Nubert" is a trademark of Nubert electronic GmbH. This tool is provided for interoperability purposes under EU Directive 2009/24/EC.