As a Service
Systemd is system and service manager that is used by most popular linux distros including Ubuntu, Fedora, Pop!_OS, Debian, and Arch.
This setup will create a user service that runs on login.
Create A Unit File
Section titled “Create A Unit File”Create a new service file for multi-scrobbler under your HOME config:
mkdir -p ~/.config/systemd/usertouch ~/.config/systemd/user/multi-scrobbler.serviceIn a text editor add contents below to the file you created, multi-scrobbler.service:
[Unit]Description=multi-scrobblerAfter=network.target
[Service]Type=simpleWorkingDirectory=/path/to/multi-scrobbler/directoryExecStart=npm run startRestart=no
[Install]WantedBy=default.targetStart the Service
Section titled “Start the Service”Save the file then run:
systemctl daemon-reloadsystemctl --user enable multi-scrobbler.servicesystemctl --user start multi-scrobbler.serviceThis will
- scan for new services and pickup our multi-scrobbler user service
- enable the service to run at login automatically
- start the service now
Other Service Methods
Section titled “Other Service Methods”Open a PR if you would like to document setting up multi-scrobbler for other service managers!