simple script to control your Lyrion Music Server
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-11-18 23:04:32 +01:00
.gitignore initical commit 2025-07-28 13:18:53 +02:00
lmon add lmon to the package 2026-11-18 22:58:06 +01:00
lmplay push version to 3.4 2026-11-18 23:04:32 +01:00
lmplay-completion remove the need of typing --val for command parameters 2026-09-09 15:42:29 +02:00
mute mute: use a pipeline instead of single commands 2026-09-09 15:20:47 +02:00
PKGBUILD push version to 3.4 2026-11-18 23:04:32 +01:00
README.md update README 2026-10-01 13:37:05 +02:00

lmplay

General

lmplay is a script to control your lyrion music server for some basic operations. Its main usage is to command your lyrion server to play a given radio station. It uses the station list radio_stations, which has more than 900 stations included.

List of functionality

  • play a pre-configured radio station
  • play any stream by URL
  • play a local file (local means: file on the host running lms)
  • play/stop/pause/unpause/mute/unmute any connected player
  • sync/unsync players
  • skip current title, play next one from the playlist
  • get the current playlist
  • get the current title/artist/album
  • get a complete list of pre-configured radiostations
  • control the volume of your player
  • shuffle/repeat/clear your playlist
  • trigger a rescan of your music library
  • default-values can be set as environment variables
  • comes with bash-completion

Usage

lmplay - tell Lyrion Music Server to play a given radio station

usage: lmplay [OPTIONS] [station|COMMAND]

     OPTIONS
        -h|--help         show this help screen
        -s|--station s    play station s
        -l|--lmserver s   host of LMS [localhost]
        -p|--port p       port of LMS [9000]
        -P|--sbport p     port for squeezebox protocol [9090]
        -a|--add          instead of replacing the current playlist, add the
                          given station to the end of the current playlist
        -a|--append       synonym for -add
        -i|--insert       instead of replacing the current playlist,
                          play the given station after the current song
        -c|--client c     hostname or IP of client [choosen by LMS]
        -C|--config c     use stationlist c instead of
                          /usr/share/radio_tv_stations/radio_stations
        -u|--url u        url to play
        -v|--verbose      show generated url
        -V|--version      show version and exit
        -x|--execute      execute a single COMMAND on lms. See below.
        -g|--getstations  table of all known stations and their urls
        --listcommands    shortlist of all implemented commands (for bash completion)
        --liststations    shortlist of all known stations (for bash completion)

     COMMANDS
        pause          toggle pause/unpause
        stop           stop the player
        play           start playing
        next           play next from playlist
        prev           play previous from playlist
        repeat_title   repeat current title
        repeat_list    repeat current playlist
        repeat_off     don't repeat anything
        shuffle        toggle shuffle (off -> titles -> albums -> off)
        shuffle_title  shuffle titles
        shuffle_off    don't shuffle
        clearlist      delete the current playlist
        sync c2        add c2 to syncgroup of client
        unsync         remove client from its syncgroup
        getsync        get which players are synced

        mute           toggle muting
        volume val     change volume abs    0..100
                                     rel -100..+100
        volup,vu       short for -x volume +5
        voldown,vd     short for -x volume -5

        rescan         trigger rescan of music library
        status         get the current playlist
        curr           get the current title/artist/album
        power          toggle on/off
        on             switch on
        off            switch off

     ENVIRONMENT
        LMSERVER  default host of LMServer [not set]
        LMPORT    default html port of LMServer [not set]
        LMSBPORT  default squeezebox port of LMServer [not set]
        LMCLIENT  default IP/hostname LMClient [not set]

If no radio station is given on the command line, and yad is installed, start yad with a graphical dialog, where you can choose a station.

Installation

Dependencies

  1. radio_stations, should be installed as /usr/share/radio_tv_stations/radio_stations
  2. curl to talk to your lyrion music server
  3. dig from the package bind, to resolve hostnames to ip-addresses
  4. optional: yad for graphical selection of radio station (if none is given on the command line)

Program installation

sudo install -D -m 644 lmplay-completion /usr/share/bash-completion/completions/lmplay
sudo install -D -m 755 lmplay /usr/bin/lmplay

Arch users use the PKGBUILD (be sure to have installed radio_stations before, also via makepkg):

makepkg -sic

Notes

Examples

play the pre-configured station www.dylanradio.com:

lmplay dyl

pause your squeezebox, which has hostname kitchenradio:

lmplay pause --client kitchenradio

play pre-configured station Radio Paradise after the current title:

lmplay --insert paradise

add Classical Radio Sir Simon Rattle at the end of the playlist:

lmplay --add cr_simonrattle

listen part one of the Seelentanz-podcast via URL:

lmplay --url 'https://audio.podigee-cdn.net/197118-m-6e3f8c64de2cfc8836e886e4d8459f2a.mp3'

play a local file ('local' means: on the host running lms):

lmplay --url file:///path/to/musicfile.flac

pause the current playlist

lmplay pause

trigger a rescan of your music library

lmplay rescan

get the current playlist

lmplay status

get current title/artist/album

lmplay curr