Control Spotify from shell
First thing to do is to be able to control spotify from command line. Spotify has DBus interface and supports MPRIS2 DBus specification. But I’ve found a bash script, which wraps it in convenient functions here. Since I’d like to display current artist and song in the Awesome widget I need them to be in one line, so I’ve added another method to the bash script and added it in my Github:
Let’s install it:
So from now you are able to control Spotify from command line! Try it: sp help
.
Widget, Awesome widget
This widget is not compatible with v4.0 of Awesome WM. For v4.0 use this one
Create spotify.lua with following content under /home/.config/awesome or clone it from this repo.
Now include it in rc.lua and add to your wibox:
Restart awesome, turn on some music and you’ll see it:
Keyboard shortcuts
Nothing special here, I prefer to use Mod4
+.
for next track, Mod4
+,
for previous and Mod4
+/
for play/pause: