Skip to content

Instantly share code, notes, and snippets.

@bitjockey42
Created April 20, 2014 16:39
Show Gist options
  • Star 45 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save bitjockey42/11118592 to your computer and use it in GitHub Desktop.
Save bitjockey42/11118592 to your computer and use it in GitHub Desktop.
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
Copy link

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

@kingosticks
Copy link

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

@quasli
Copy link

quasli 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