Eric's Web Page

Code

Here's some projects I'd like to share:

Song Detector

Codeberg repository

Every now and then I like to stream myself playing songs on the guitar. My workflow is as follows:

  • My main monitor is displaying the chords and lyrics of the song I'm currently playing, from the website Ultimate Guitar.
  • My second monitor is used to preview the stream and display chat. The software used for streaming is OBS.

This program works like this:

  1. A shell script using a tool called kdotool (because I'm currently running CachyOS with KDE Plasma Wayland) looks at all active windows with Ultimate-Guitar.com in the name. If it finds one, it sends the name to a C++ program.
  2. That C++ program cleans the string, and outputs a nice "Song" by Artist format to a text file.
  3. There is a text source in OBS that is constantly looking at that text file. This way, the name of the current song being looked at is displayed on stream!