dronir / SpotifyControl

Control Spotify from the command line on macOS
450 stars 56 forks source link

Control Spotify at OS X Terminal

An AppleScript for controlling Spotify through a terminal:

The scenario for which it was originally designed is controlling Spotify, which is playing on a Mac, via ssh, while working on a Linux machine on the other side of the room.

Currently supported functions are: play/pause, next/previous track, jumping in time, toggling shuffle/repeat and changing volume. This pretty much covers everything the AppleScript hooks of Spotify allow.

Tested Platforms

Installation

The simplest way to install the script is to clone the repository, cd into repository's directory, and run the command below to make a symbolic link into /usr/local/bin/:

ln -s $(pwd)/SpotifyControl /usr/local/bin/spotify

Usage

Over SSH

To enable the SSH server on OS X, go to Sharing in the System Preferences and enable Remote Login. The Sharing screen will also then tell you the command to use to connect to your Mac in the local network.

License

You may use, adapt, modify, and etc. Any way you want.