Skip to content

Instantly share code, notes, and snippets.

@peel
Created March 21, 2017 11:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save peel/366554553d93c82e33405c123ed7d6cc to your computer and use it in GitHub Desktop.
Save peel/366554553d93c82e33405c123ed7d6cc to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
#install dependencies
brew install gstreamer gst-plugins-good gst-plugins-ugly gst-python
#menubar ui
brew cask install kmbmpdc
#mopidy plus spotify and web ui
pip install mopidy mopidy-spotify mopidy-iris
#set spotify credentials
cat <<EOT >> ~/.config/mopidy/mopidy.conf
[mpd]
enabled = true
hostname = 0.0.0.0
port = 6600
zeroconf = $hostname
[http]
enabled = true
hostname = 0.0.0.0
port = 6680
zeroconf = $hostname
[spotify]
enabled = true
username = ...
password = ...
bitrate = 320
[iris]
enabled = true
EOT
#run as a service
cat <<EOT >> ~/Library/LaunchAgents/org.nixos.mopidy.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>EnvironmentVariables</key>
<dict>
<key>PATH</key>
<string>/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/local/sbin</string>
</dict>
<key>KeepAlive</key>
<true/>
<key>Label</key>
<string>org.nixos.mopidy</string>
<key>ProcessType</key>
<string>Interactive</string>
<key>Program</key>
<string>/usr/local/bin/mopidy</string>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
EOT
#enjoy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment