[Unit] Description=Librespot instance for %I After=network.target [Service] Type=simple # Create the pipe and cache folders automatically ExecStartPre=/usr/bin/mkdir -p /opt/spotify-bot/pipes ExecStartPre=/usr/bin/mkdir -p /var/cache/librespot/%I ExecStartPre=/usr/bin/rm -f /opt/spotify-bot/pipes/%I_pipe ExecStartPre=/usr/bin/mkfifo /opt/spotify-bot/pipes/%I_pipe # Launch Librespot using OAuth and saving credentials to a local cache folder ExecStart=/usr/bin/librespot -n "Server Speaker (%I)" --backend pipe --device /opt/spotify-bot/pipes/%I_pipe --cache /var/cache/librespot/%I --enable-oauth Restart=always RestartSec=10 [Install] WantedBy=multi-user.target