ulauncher extension that provides Spotify controls through WebAPI.
Note: some playback features are allowed only for Spotify Premium subscribers (see Troubleshooting
below).
There's a great Ulauncher extension pywkm/ulauncher-spotify. However, ulauncher-spotify uses dbus to control Spotify, exposing a very limited number of Spotify features to the user.
In contrast, this extension makes use of Spotify's Web API through which it is possible to use almost all Spotify features. The aim is to provide direct access to most features that make sense for a command runner.
Please use the default way to install ulauncher extensions:
Preferences -> Extensions -> Add extension -> https://github.com/the-lay/ulauncher-spotify-api
.
On the first run, the extension will try to install the dependencies automatically.
For various reasons (pip is not installed, hardened permissions, non-standard installations...) automatic installation can fail,
and the Ulauncher will report something along the lines of ModuleNotFoundError: No module named 'spotipy'
.
In that case, first, make sure you have pip installed: pip -V
should show a version. If pip binary is not found,
please install it, e.g.: sudo apt install pip3
. Next, you have to install python dependencies:
pip3 install "spotipy==2.16.1" "requests==2.23.0"
and then restart Ulauncher.
In case you have multiple Python environments on your system (PyEnv, Conda etc.),
please note that you have to install the dependencies to the default system python that Ulauncher uses.
Most likely, this will be the command you want: /usr/bin/python3 -m pip install "spotipy==2.16.1" "requests==2.23.0"
Extension's default keyword is sp
. When you use the extension for the first time, you will have to
go through OAuth authentication and allow access to your Spotify account.
After that, you will be able to use the extension.
Note: if you ever want to revoke extension's access, you can do so in the Apps tab of your Spotify settings.
sp
- first run or
when access token is expired)sp
- default menu)sp switch
)sp repeat
)sp shuffle
)sp album/track/artist/playlist search_query
)sp search search_query
)sp song
= sp track
, sp s
= sp search
, sp vol
= sp volume
)sp ?
or sp help
)sp history
)sp volume N
)sp podcast
)sp radio
)There might be more TODO in github issues.
If you have any suggestions or feel that something is missing, please open a new issue.
Spotipy's authentication workflow sets up a tiny web server to accept back Spotify's access token. By default, port 8080 is used. If it is taken, please select a different one in the extension settings.
Unfortunately, Spotify does not provide API access for free users for the following actions:
You will see 403 errors if you try to use those as a free user.