Better solution is just using a bash script This is my solution lyrics-line.sh
Successor to lyrify
Waylyrics is a Waybar module that retrieves the currently playing lyrics from Spotify using CFFI. It integrates with Waybar via the CFFI interface and displays synchronized or plain lyrics in real-time.
-
D-Bus Communication:
- The module communicates with Spotify via D-Bus (
sdbus-c++) to fetch metadata, including the song title, artist, and playback position.
- The module communicates with Spotify via D-Bus (
-
Fetching Lyrics:
- It queries the lrclib.net API to fetch lyrics, caching results to
~/.cache/waylyricsfor efficiency. - If synchronized lyrics are available, it determines the current line based on the playback position.
- If only plain lyrics exist, it approximates the current line.
- It queries the lrclib.net API to fetch lyrics, caching results to
-
Integration with Waybar:
- The module is built as a shared library (
waylyrics.so) and loaded via Waybar's CFFI system. - It runs a separate thread to update the lyrics in real time.
- The module is built as a shared library (
To build and run this module, install the following:
-
Build dependencies:
g++(C++ compiler)meson&ninja(build system)pkg-config
-
Libraries:
gtk-3sdbus-c++curlnlohmann-json
CI builds are up. (check tags/releases)
Run the following:
just # setup meson
just build-waylyrics # builds the shared libraryThis will compile waylyrics.so and place it in the current working directory.
Add the following to your Waybar configuration:
"cffi/lyrics": {
"module_path": "/<path to library>/waylyrics.so"
}Restart Waybar, and you should see lyrics appear when playing music on Spotify.
A justfile (Just build system) is included to simplify build commands:
just→ Compiles the module.just build-waylyrics→ Installswaylyrics.soto the appropriate directory.just clean→ Removes compiled artifacts.
MIT License. Contributions welcome!
