Skip to content

SnootierMoon/emacs-spotify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 

Repository files navigation

Emacs Spotify

This package allows you to control Spotify from within Emacs.

Getting Started

This package works out of the box once it’s installed.

Installing with use-package and vc-use-package

The use-package and vc-use-package are built-in on Emacs 30.

(use-package spotify
  :vc (emacs-spotify
       :url "https://github.com/SnootierMoon/emacs-spotify"))

Usage

Logging in to Spotify

  • Login to Spotify with M-x start-spotify <RET>.

Controlling The Player

[SP] refers to the value of spotify-keymap-prefix, which can be nil if you would like to set up keymaps yourself.

  • Play the current song with M-x spotify-play <RET> ([SP] p p).
  • Pause the current song with M-x spotify-pause <RET> ([SP] p P).
  • Play the next song with M-x spotify-next <RET> ([SP] p f).
  • Play the previous song with M-x spotify-prev <RET> ([SP] p b).
  • Control the volume with M-x spotify-volume <RET> ([SP] p v).

Privacy Disclaimer

Spotify API requests made through this package will use my own SDA (Spotify developer application) by default, called “Emacs Spotify”. In the Spotify Developer Dashboard, I can view general analytics including the number of daily users and geographical regions where my SDA is being used. However, (as far as I know) I do not have access to individual user information, and this package does not collect any individual information when you use it (the source code is small enough that you can verify this yourself).

Alternatives Comparison

This plugin is a personal project that I work on for fun. There may be more practical alternatives if you want a Spotify plugin (note that the following descriptions may be inaccurate or out of date, please confirm for yourself):

  • danielfm/smudge
    • D-Bus, AppleScript, Web API
    • create playlists, search tracks/playlists, Spotify Connect (queue, playback), and more
    • MELPA
  • jao/espotify, counsel-spotify, ivy-spotify
    • D-Bus, Web API
    • search tracks/playlists, Spotify Connect (queue, playback)
    • Counsel/Ivy integration
    • MELPA
  • krisajenkins/helm-spotify
    • D-Bus, AppleScript, Web API search (no login)
    • search track, play track/album, playback
    • Helm integration
    • MELPA
  • Lautaro-Garcia/counsel-spotify
    • D-Bus, AppleScript, Web API
    • search/play track/artist/playlist/album, playback
    • Helm integration
    • MELPA
  • remvee/spotify
    • D-Bus
    • playback
    • MELPA
  • wandersoncferreira/helm-spotify-plus
    • D-Bus, AppleScript, Web API (SDA credentials provided)
    • search track, play track/album, playback
    • Helm integration
    • MELPA
  • Both D-Bus and AppleScript are local and do not require an internet connection. Web API access for playback manipulatioin requires an internet connection and Spotify Premium (in order to use Spotify Connect). Therefore, many users will probably prefer a plugin that supports D-Bus and AppleScript. Since I am not currently interested in using either of these, I may never implement them into this plugin myself.

    Note that D-Bus is supported on Unix-based operating systems, and AppleScript is supported on Darwin-based operating systems.

  • For Web API usage, all of the plugins listed above either provide SDA credentials in the source code, or require you to create your own SDA. Instead, my plugin uses PKCE, which works out of the box and allows users to obtain temporary access tokens without me having to expose SDA credentials. My plugin periodically refreshes this access token automatically, but when you initially obtain this token upon starting Emacs, or if the token somehow expires, you will need to authorize the plugin again through a “Login with Spotify” page. My plugin can open this page automatically for you in the browser when needed, and this behavior is customizable to be unobtrusive (can be disabled entirely). However, some users may find it more convenient to just make their own SDA and avoid this hassle. Note that newly created SDAs will be in “development mode” which imposes some restrictions (not a problem for individual use), but since my SDA was created before Spotify made this policy change, my SDA is in “extended quota mode” and does not have these restrictions.

Changelog

  • v0.0.3
    • More control of auth behavior through custom settings
    • Implement 401 handling (login prompt when auth lost)
    • Re-implement auto-close of “Login with Spotify” redirect page
  • v0.0.2
    • bump minimum Emacs version to 29.1
    • rename spotify-start to start-spotify, and spotify-stop to stop-spotify
    • implement restart-spotify
    • add privacy disclaimer in README
    • improve ergonomics for playback control commands
    • spotify-play, spotify-pause, spotify-next, and spotify-prev are now synchronous and display error messages
    • remove dependency on simple-httpd and related configs such as spotify-stops-httpd
  • v0.0.1
    • implement spotify-start, spotify-stop, spotify-play, spotify-pause, spotify-next, and spotify-prev

To-do

More API coverage

License

GPL v3

About

A plugin to control Spotify from within Emacs.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published