waybar-lyric

[!IMPORTANT]
🔥 Found this useful? A quick star goes a long way.
A CLI tool that displays lyrics on your
Waybar for Linux systems.
[!NOTE]
If you're using waybar for the first time checkout the example configuration.

Description
waybar-lyric fetches and displays real-time lyrics on your Waybar. It provides a
scrolling lyrics display that syncs with your currently playing music, enhancing your
desktop music experience.
Supported Players
Features
- Real-time display of the current song's lyrics
- Click to toggle play/pause
- Smart caching system:
- Stores available lyrics locally to reduce API requests
- Remembers songs without lyrics to prevent unnecessary API calls
- Custom waybar tooltip
- Configurable maximum text length
- Detailed logging options
- Profanity filter
- Partial (
badword -> b*****d)
- Full (
badword -> *******)
Installation
Prerequisites
- Any of the supported browser
- DBus connectivity
- waybar
- go
Install
AUR
yay -S waybar-lyric
yay -S waybar-lyric-git
Nixpkgs
environment.systemPackages = [
pkgs.waybar-lyric
];
home.packages = [
pkgs.waybar-lyric
];
# without flakes:
nix-env -iA nixpkgs.waybar-lyric
Manual
You need GNU make and install
- Build the waybar-lyric
git clone https://github.com/Nadim147c/waybar-lyric.git
cd waybar-lyric
make
- Local install
make install PREFIX=$HOME/.local
- Global install
sudo make install PREFIX=/usr
go install (Not recommended)
Note: You have to make sure that $GOPATH/bin/ in your system PATH before
running waybar.
go install github.com/Nadim147c/waybar-lyric@latest
Configuration
Waybar Configuration
The recommended way to configure waybar-lyric is to generate the configuration
snippet using the built-in command:
waybar-lyric init
This will output the proper JSON configuration snippet that you can copy directly
into your Waybar config.jsonc file.
Style Example
Add to your style.css:
#custom-lyrics {
color: #1db954;
margin: 0 5px;
padding: 0 10px;
}
#custom-lyrics.paused {
color: #aaaaaa; /* Set custom color when paused */
}
Troubleshooting
If you encounter issues:
- Check that any of the supported browser is running is running and connected
- Run with verbose logging
waybar-lyric -v --log-file=/tmp/waybar-lyric.log
- Verify DBus connectivity with:
dbus-send --print-reply \
--dest=org.mpris.MediaPlayer2.spotify \
/org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get \
string:org.mpris.MediaPlayer2.Player \
string:PlaybackStatus
Hacking
Contributions are welcome! Feel free to submit a Pull Request.
License
This repository is licensed under AGPL-3.0. Thanks to
LrcLib for providing lyrics.