A CLI tool that displays lyrics on your Waybar for Linux systems.
demo.mp4
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.
- 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->*******)
- Partial (
- Waybar
- A working Spotify installation
- DBus connectivity
- From AUR; Recommended for Arch
btwusers.
yay -S waybar-lyric-git- With
go installNote: You have to make sure that
$GOPATH/bin/in your systemPATHbefore running waybar.
go install github.com/Nadim147c/waybar-lyric@latest- Or install from source
git clone https://github.com/Nadim147c/waybar-lyric.git
cd waybar-lyric
go installUsage: /usr/bin/waybar-lyric [options]
Get lyrics on waybar.
Options:
-c, --compact Output only text content on each line
-f, --filter-profanity string Filter profanity from lyrics (values: full, partial)
-i, --init Display JSON snippet for waybar/config.jsonc
-o, --log-file string Specify file path for saving logs
-l, --lyric-only Display only lyrics in text output
-m, --max-length int Set maximum character length for lyrics text (default 150)
-q, --quiet Suppress all log output
-t, --toggle Toggle player state between pause and resume
-C, --tooltip-color string Set color for inactive lyrics lines (default "#cccccc")
-L, --tooltip-lines int Set maximum number of lines in waybar tooltip (default 8)
-v, --verbose Enable verbose logging
-V, --version Display waybar-lyric version information
The recommended way to configure waybar-lyric is to generate the configuration snippet using the built-in command:
waybar-lyric --initThis will output the proper JSON configuration snippet that you can copy directly
into your Waybar config.jsonc file.
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 */
}If you encounter issues:
- Check that Spotify 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
This repository is licensed under AGPL-3.0. Thanks to LrcLib for providing lyrics.
Contributions are welcome! Please feel free to submit a Pull Request.