Skip to content

Instantly share code, notes, and snippets.

@michaldarda
Forked from bitjockey42/mopidy.md
Last active August 29, 2015 14:15
Show Gist options
  • Save michaldarda/4ad33137eaf2ddda55d0 to your computer and use it in GitHub Desktop.
Save michaldarda/4ad33137eaf2ddda55d0 to your computer and use it in GitHub Desktop.

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment