toply

toply is a Python desktop app I began to develop back in 2017. Its main features include searching the web for lyrics of songs being played and displaying them above other open windows, according to the timing of the execution. I actually made a lot of proggress at that time however, as many things have changed since then, like my fluency in the programming language and my main desktop environment, it seemed like a good idea to refact the entire project, which also would lead me to give it a general upgrade in terms of libraries etc.

The first drafts of this post included an extensive explanation of technical details I've come to consider as not as interesting for a blog, so I'm going to try to just leave you with a somewhat comprehensive summary of what I am doing:

  • Get metadata (title, artists etc) about the song being played via D-Bus for desktop media players (e.g.: VLC) and a web extension for the same purpose but with web browsers (e.g.: Firefox), to be summed to a simple local web server.
  • Search online for lyrics, using Searx, so I can get a larger pool of results, in oposition to using a limited set of lyrics websites, which could not cover all of my underground playlists - the metasearch engine will also assure some extra privacy.
  • Extract the text from the best results, using the same library as Firefox's tool Reader View, then clean the most common noise found in those websites.

Afterwards, there would come the syncing part. I used GTK+ for showing a small window with the lyrics lines inside it, and adapted a mechanism to allow the user to go back-and-forth in the song, pointing the excerpt they're currently listening to. A .lrc file is saved to ~/toply/lrc. I'm still thinking of a way to ease the sharing of these files, as they will certainly be importable.

The last important thing is: the always on top component was not working well - despite of the interface looking fine, there were many delays when changing the content inside the text boxes, aside from a suspicious level of CPU consumption. In a few words: it must be completely rebuilt.


It's exciting to be working on toply again, I hope you've enjoyed reading a little about it. I'll try my best to keep this new old blog updated with my advances on the development.