Skip to content

Instantly share code, notes, and snippets.

@gwillem
gwillem / add-current-spotify-song-to-favorites.py
Last active September 16, 2021 00:48
Ubuntu: add current Spotify song to favorites (playlist)
#!/usr/bin/env python3
"""
gwillem@gmail.com
Read current playing track from D-BUS and add it to my favorites
playlist. Any previous instances of the same track on the playlist are removed.
I have mapped this script to the XF86Favorite key of my Microsoft Natural Keyboard.