A polybar module to display the current song and control Spotify playback (with experimental ad-skipping).
dbus
polybar
spotify
git clone https://github.com/v15hv4/spotify-polybar ~/.config/polybar/spotify
include-file = ~/.config/polybar/spotify/spotify.ini
enable-ipc = true
modules-center: spotify spotify-previous spotify-control spotify-next
The module can also attempt to automatically skip ads by relaunching Spotify in the background when an ad plays. However, this might be visually disruptive so it's recommended to bind the Spotify app to an unused workspace.
To turn off skipping ads, flip to ADSKIP=0
in spotify.sh
.
for_window [class="Spotify"] move to workspace n # replace n with desired ws number
Default glyphs (as used in the screenshot) are from the waffle bitmap font.
They can be changed in spotify.ini
as follows:
[module/spotify]
format-prefix = "<icon prefixing current song status>"
format-prefix-foreground = <prefix icon color hex>
[module/spotify-control]
hook-0 = echo "<pause icon>"
hook-1 = echo "<play icon>"
[module/spotify-next]
exec = echo "<next song icon>"
[module/spotify-previous]
exec = echo "<previous song icon>"