simple script to control your Lyrion Music Server
Find a file
2025-11-25 14:10:52 +01:00
.gitignore initical commit 2025-07-28 13:18:53 +02:00
lmplay push version to 2.0 2025-11-25 14:10:52 +01:00
lmplay-completion Allow a command without -x 2025-08-22 22:09:21 +02:00
PKGBUILD push version to 2.0 2025-11-25 14:10:52 +01:00
README.md add command 'curr' to show current title/artist/album 2025-11-13 16:32:58 +01: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 the current playlist
  • trigger a rescan of your music library
  • get the current playlist
  • get the current title/artist/album
  • get a complete list of pre-configured radiostations
  • control the volume of your player
  • 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]
        -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)
        --val v           parameter for a command given with -x

     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

        mute           toggle muting
        volume         change volume abs, needs --val    0..100
                                     rel, needs --val -100..+100
        volup          short for -x volume --val +5
        voldown        short for -x volume --val -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 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 mac-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