Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
An installation and setup guide for mopidy on Arch Linux.

Mopidy on Arch Linux

mopidy

Installation

Install from the AUR.

packer -S mopidy
packer -S mopidy-spotify
packer -S ncmpcpp

Configuration

Create a directory to store the mopidy config.

mkdir -p ~/.config/mopidy

Then create mopidy.conf in that directory:

emacs ~/.config/mopidy/mopidy.conf

A simple config can look like:

[spotify]
enabled = true
username = _your_username_here_
password = _your_super_seekrit_password_here_

Then save that file.

Initialization as a service

The AUR package for mopidy includes cool things like systemd init scripts. We will be running it as a user session.

Create a directory to store the *.service files under $HOME:

mkdir -p ~/.config/systemd/user

You can find the service file in /usr/lib/systemd/system/mopidy.service. Copy this file into the user directory.

cp /usr/lib/systemd/system/mopidy.service ~/.config/systemd/user/

Edit the mopidy.service file.

emacs ~/.config/systemd/user/mopidy.service

It should look something like this:

[Unit]
Description=mopidy
After=network.target

[Service]
Type=simple
# User=mopidy # this should be removed
ExecStart=/usr/bin/mopidy

[Install]
WantedBy=multi-user.target

Then check if the user session is running.

systemctl --user status

Enable the mopidy service as a user.

systemctl --user enable mopidy

Run the mopidy service.

systemctl --user start mopidy

To check if it ran successfully:

systemctl --user status mopidy

ncmpcpp

Run ncmpcpp:

ncmpcpp

You should be able to see [spotify] as a link in Browse (when you press 3).

@quizzmaster

This comment has been minimized.

Copy link

commented Jun 10, 2016

The target should be
WantedBy=default.target
there is no multi-user.target for systemd in user mode!

@kingosticks

This comment has been minimized.

Copy link

commented Oct 4, 2017

That mopidy-spotify config is outdated, the current minimum config can be found at https://github.com/mopidy/mopidy-spotify#configuration

@quasli

This comment has been minimized.

Copy link

commented May 9, 2018

When I start the Mopidy daemon with the --user flag, the configuration file in /etc/mopidy is used instead of ~/.config/mopidy/mopidy.conf.
Is there a way to change this or am I misunderstanding something?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.