This kind of message system is designed for two specific cases: communication between desktop applications in the same desktop session and communication between the desktop session and the operating system, which includes any system processes (this is our case).Ī D-Bus system has several layers and one of them is formed by wrapper libraries, which is the kind of tool we are using here.
Luckily, this answer by jooon on Stackoverflow saved me a lot of time, so kudos to you sir.īasically, as I am a Linux user, the Spotify client I use automatically creates a D-Bus interface called MPRIS - Media Player Remote Interfacing Specification.įrom the D-Bus specifications page, the D-Bus API is commonly used to implement a service which will be consumed by multiple client programs.
This was one of the things I had no clue how to do it so I had to do some googling to accomplish that. There, you will also have instructions on how to run it, but keep in mind that I will guide you through that in this post as well :)
If you want to check the full script before continuing, you can go to this repository on Github. I still don't understand why that was removed but all we got now is the Behind the Lyrics feature, which shows some useless information and small snippets of the lyrics for the song we are listening (it seems it is available only on mobile devices).įrom here I will start to tear apart the script following the order it was implemented. Also, as I was a loyal user of I knew that they have a large public API I could get some help from.įor the long-term Spotify users, you probably remember when Spotify had the functionality to show the song lyrics within the desktop app, right? Good old times.
So, at first, I knew I was going to need something that would provide me with an interface I could use to connect that script with the Spotify service running on my computer. The goal was to implement a script with which I could fetch the lyrics for the song currently playing on Spotify. I started basically with some knowledge of Python and knowing which API I was going to use to accomplish that idea.
This was one of those moments that you have an idea and you get really excited about it but have no clue on whether that would work as you expect or not. This post was originally published on my personal blog.įor this post, I decided to talk about a Python script I wrote last year, which I am still using it very often nowadays.