Spotify

From Gentoo Wiki
Jump to:navigation Jump to:search
Resources

Spotify is a digital music streaming service that provides a proprietary Linux client.

Installation

USE flags

USE flags for media-sound/spotify Spotify is a social music platform

libnotify Enable desktop notification support
local-playback Allows playing local files with the Spotify client
pax-kernel Triggers a paxmarking of the main Spotify binary
pulseaudio Controls the dependency on pulseaudio or apulse
systray Pulls in dependencies needed for systray support on some desktop environments

Emerge

Install Spotify:

root #emerge --ask media-sound/spotify
Note
Please ensure that net-misc/curl is built with the bfd linker (default) instead of the gold linker. See bug #651770 for more information.

Control via MPRIS

MPRISis a D-Bus interface which provides a common API to control media players.

Spotify supports MPRIS.

Prequisites if using a window manager

In $HOME/.xinitrc, make the window manager start with dbus-run-session.

Otherwise, Spotify won't provide an MPRIS interface.

FILE $HOME/.xinitrcStarting bspwm with D-Bus
exec dbus-run-session bspwm

With dbus-send

The most simple approach to controlling Spotify is using dbus-send.

Play/pause:

user $dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause

Next:

user $dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Next

Previous:

user $dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Previous

With playerctl

Install media-sound/playerctl.

Play/pause:

user $playerctl play-pause

Next:

user $playerctl next

Previous:

user $playerctl previous

More info about playerctl can be found on its GitHub page.