#mpris #audio-player #command-line-interface #host-port #squeezelite #slimserver

app mprisqueeze

A command-line client for controlling squeezelite via MPRIS

8 releases

0.1.7 Oct 3, 2024
0.1.6 Jul 29, 2024
0.1.5 Feb 3, 2024
0.1.4 Nov 13, 2023
0.1.2 May 22, 2023

#105 in Audio

Download history 14/week @ 2024-09-14 20/week @ 2024-09-21 126/week @ 2024-09-28 30/week @ 2024-10-05 6/week @ 2024-10-12

429 downloads per month

MIT license

37KB
935 lines

mprisqueeze

CI

mprisqueeze is a wrapper over squeezelite. It starts squeezelite in the background and exposes an MPRIS interface to control it with MPRIS clients such as playerctl.

By default, mprisqueeze will try to discover the LMS server on the local network. To specify a host and a port:

$ mprisqueeze -H somehost -P 9000

The default command line for squeezelite is:

squeezelite -n {name} -s {server}

Before calling squeezelite, mprisqueeze replaces:

  • {name} by the name of the player, Squeezelite by default
  • {server} by the LMS server IP, either automatically discovered either set with the -H switch

It then starts squeezelite registering itself on LMS with the name SqueezeLite. To use another name, one can use:

$ mprisqueeze -p my-player

The command to start squeezelite can be changed with the last arguments, preceded by --, for example:

$ mprisqueeze -- squeezelite -f ./squeezelite.log -n {name} -s {server}

Note that when using a custom command, both parameters must be present on the command line: {name} and {server}.

mprisqueeze can be automatically started on login. The most convenient way of doing that is using a user systemd unit. For example, one can set a unit called mprisqueeze in the file ~/.config/systemd/user/mprisqueeze.service:

[Install]
WantedBy=default.target

[Service]
ExecStart=mprisqueeze -- squeezelite-pulse -n {name} -s {server}
Restart=always
RestartSec=3
Type=simple

[Unit]
Description=mprisqueeze

On the next login, mprisqueeze will be automatically started. Otherwise, to start it manually:

$ systemctl --user start mprisqueeze

Dependencies

~14–28MB
~427K SLoC