Magic Mirror Module - A module for Magic Mirror that displays the current playing song on a machine that exposes the MPRIS2 interface by WebSocket (which is another script I've wrote)
- Clone repository into
../modules/
inside your MagicMirror folder. - Add the module to the Magic Mirror config.
{
module: "MMM-MPRIS2-WebSocket",
position: "top_left",
header: "Playing now",
config: {
host : <host of target machine>,
port : <port of target machine>
}
},
- Run This script on your target machine, see below for autostart with systemd.
- Done! Start playing a song with a MPRIS-capable player and it should show up.
host
: The machine that has the info on which song is playing, requiredport
: The port of the remote machine that is running the mpris2_websocket.py script, default is 9000retryInterval
: How long in milliseconds it should wait before trying to make a new connection if the remote server isn't answering or the connection has been dropped, default is 5 minutes
- Create a file
mpris2websocket.service
in~/.local/share/systemd/user
and make it executable with the following:
[Unit]
Description=MPRIS2 Websocket Controller
[Service]
Environment=DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
Type=simple
ExecStart=<absolute folder for script>/mpris2_websocket.py -n <netmask to allow>
[Install]
WantedBy=default.target
- Reload units
systemctl --user daemon-reload
- Enable it by running
systemctl --user enable mpris2websocket.service
- Start it by running
systemctl --user start mpris2websocket.service