ncsb - An ncurses Squeezebox controller for Logitech Media Server (LMS)
Features
- slick curses TUI to control your squeezeboxes / squeezelite
- minimal GUI with album art display (PySide6)
- full-featured CLI for scripting and remote control
- free-text and contextual search
- current playlist management
- player control
- album art in sixel-compliant terminals (experimental, off by default)
Installation
Requires Python 3.9+, with packages: hy, hyrule, requests, click.
$ pip install -e .
Or install from PyPI:
$ pip install ncsb
For optional cover art in terminal, also install libsixel-python and a sixel-supporting terminal (see below).
For the GUI:
$ pip install ncsb[gui]
Usage
GUI
$ ncsb gui
Minimal Amberol-inspired player with:
- Player selector dropdown
- Album art display
- Track info (title, artist)
- Progress slider
- Play/pause, prev/next controls
- Volume slider
CLI
The unified ncsb command provides both TUI and CLI access:
$ ncsb -H lms-server players
$ ncsb -H lms-server -P juno info
$ ncsb -H lms-server search miles --kind artists
Global options:
-H, --host— LMS server host (default: $LMS_HOST or localhost)-p, --port— LMS server port (default: $LMS_PORT or 9000)-P, --player— Player name (default: $NCSB_PLAYER)-m, --mac— Player MAC address
Commands:
| Command | Description |
|---|---|
gui |
Launch GUI player |
tui |
Launch ncurses TUI |
play, stop, pause |
Playback control |
next, prev, seek, jump |
Track navigation |
volume, vol+, vol- |
Volume control |
power |
Power on/off |
current |
Show playlist |
shuffle, repeat |
Playlist modes |
search, search-all |
Library search |
load |
Load album/artist/track |
info, playing, status |
Status display |
players, serverstatus, version |
Server info |
config |
Show config file and settings |
radio, sleep |
Radio and sleep timer |
Per-command help: ncsb search --help
TUI
$ ncsb tui lms-server
In any screen, press ? for available commands.
Environment Variables
| Variable | Description |
|---|---|
LMS_HOST |
Default LMS server hostname |
LMS_PORT |
Default LMS server port |
NCSB_PLAYER |
Default player name |
Config File
Create ~/.config/ncsb/config.toml:
host = "sol"
player = "juno"
port = 9000
Precedence (highest to lowest):
- CLI arguments
- Environment variables
- Config file
- Built-in defaults
Show current config: ncsb config
Examples
# List players
ncsb -H sol players
# Show current track
ncsb -H sol -P juno info
# Search and play
ncsb -H sol -P juno search kind of blue --kind albums
ncsb -H sol -P juno load album 6468
# Volume control
ncsb -H sol -P juno volume 75
ncsb -H sol -P juno vol+ 5
# Play radio stream
ncsb -H sol -P juno radio https://stream.example.com/mp3 --title "Jazz FM"
# Set sleep timer
ncsb -H sol -P juno sleep 30
# JSON output for scripting
ncsb -H sol -P juno playing --json
Desktop Notifications
A notification daemon script is provided in contrib/ncsb-notifyd.sh. It polls LMS and sends desktop notifications with album art when the track or playback state changes.
Requirements
ncsbinstalled and configuredjqfor JSON parsingnotify-send(libnotify) or compatible notification daemon (mako, dunst, etc.)curlfor fetching album art
Usage
# Run in background with default player
./contrib/ncsb-notifyd.sh &
# Specify player
./contrib/ncsb-notifyd.sh juno &
# Or via environment variable
NCSB_PLAYER=eos ./contrib/ncsb-notifyd.sh
Configuration
| Environment Variable | Description | Default |
|---|---|---|
NCSB_PLAYER |
Player name to monitor | From ncsb config |
POLL_INTERVAL |
Polling interval in seconds | 2 |
NOTIFY_TIMEOUT |
Notification timeout in seconds | 5 |
The script respects ncsb's config file and environment variable precedence (see ncsb config).
Sixel Terminal Support
Incomplete list of sixel-supporting terminals here
See also foot,
patched gnome-terminal?,
xterm launched with xterm -ti vt340
or with xterm*decTerminalID : vt340 in .Xresources.
If you are seeing boxes or junk instead of nice unicode symbols for play/pause etc, you need to use a font with more complete unicode support. Hack works well.
In-terminal coverart requires libsixel to be installed on your system (presumably via your package manager) and a sixel-supporting terminal. Cover art notifications require libnotify to be installed.
Bugs
- flashing when loading album art, due to working around the nasty interactions between curses and sixel
- unable to write to top left of screen with curses when sixel image is displayed
- album title text update can partially overwrite the cover art sixel image
- because the font size and resolution is not known to curses, the album art size cannot be scaled to a terminal-appropriate size
Credits
Copyright A S Sharma (2021), released under the GPL v3.0 (see LICENSE and AUTHORS). Thanks also to elParaguayo (LMSTools), Ralph Irving (squeezelite) and the Slimerver / Logitech Media Server authors for inspiration.
Metadata
Release files for ncsb 1.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ncsb-1.1.1.tar.gz | 158.6 kB | Without provenance | Details for ncsb-1.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ncsb-1.1.1-py3-none-any.whl | Python 3 | none | any | Details for ncsb-1.1.1-py3-none-any.whl |
Total release size: 196.3 kB
Release files / ncsb-1.1.1.tar.gz
| Download URL | ncsb-1.1.1.tar.gz |
|---|---|
| Size | 158.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
daf22dfa20aac05c130beac0f2519583b54e74fbbd9aa56d5c6776f0fe0c92dd
|
|
BLAKE2b-256 checksum How to use checksums |
3ebc57403e3500764feda87e9a413f7eca3590b9362d879a6fe3ded0d67ac649
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|
Release files / ncsb-1.1.1-py3-none-any.whl
| Download URL | ncsb-1.1.1-py3-none-any.whl |
|---|---|
| Size | 37.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
206be6abd7666f955f58785e5fb10aab97705ad2543ca020467b0558483af788
|
|
BLAKE2b-256 checksum How to use checksums |
1fad4f13a7956d53c996dbd2e8a21b3f7b59d0bb6670955eef68f47fe7206542
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|
Security for ncsb 1.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.