Skip to main content

An ncurses Squeezebox controller for Lyrion Media Server (LMS / slimserver / Logitech Music Server)

Project description

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):

  1. CLI arguments
  2. Environment variables
  3. Config file
  4. 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

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.

Ask DeepWiki

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ncsb-1.0.1.tar.gz (155.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ncsb-1.0.1-py3-none-any.whl (37.5 kB view details)

Uploaded Python 3

File details

Details for the file ncsb-1.0.1.tar.gz.

File metadata

  • Download URL: ncsb-1.0.1.tar.gz
  • Upload date:
  • Size: 155.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.4

File hashes

Hashes for ncsb-1.0.1.tar.gz
Algorithm Hash digest
SHA256 6f99505e1e29574e0627dedb3f59fd36ee1c17a2c61360e4844db298d8979eb5
MD5 9379d3fd481e39330941690923493170
BLAKE2b-256 0e5799bded7743aba9c01976896ac4667fe11194a91f810e38fb863a5d518bf0

See more details on using hashes here.

File details

Details for the file ncsb-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: ncsb-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 37.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.4

File hashes

Hashes for ncsb-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2d1957cc42f357924ea4e0bcbfc1a1e8c7a749d38d900eb741c74069489a9464
MD5 80ab597b4c81f6e06849c67bbb4732bc
BLAKE2b-256 512c66870a9c1af8d3bfac285a884a8bdfb5657eb001c3f7873d5bb4ebaab57c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page