MusicLib: A Full-Featured KDE Music Library Manager You Haven't Heard Of Yet


If you’re a KDE Plasma user with a local music collection, you’ve probably noticed the gap. Elisa plays music beautifully. JuK is a solid classic. But neither one manages your library — rating tracks, normalizing tags, tracking what you’ve listened to, syncing playlists to your phone, or ripping CDs with a persistent profile. You end up juggling four or five tools to do what should be one job.

That’s why I built MusicLib.

MusicLib is a full-featured open source personal music library management hub, purpose-built for KDE Plasma 6. It is not an audio player, but it integrates with Audacious, Kid3, K3b, and the KDE ecosystem.


One Database, Everything In It

MusicLib includes a setup utility musiclib-cli setup. Besides detecting your apps, it builds and maintain a lightweight DSV (delimiter-separated values) database of every track in your library — artist, album, title, duration, genre, rating, and last-played timestamp. It’s a plain text file under ~/.local/share/musiclib/data/. No SQL server, no bloat, no lock-in. Edit it directly if you like. For a 10,000+ track library it still fits comfortably under 5 MB. The MusicLib Library panel is searchable, and many database fields are directly editable. You can also filter out unrated tracks. You can play or queue tracks directly from the the panel, or rate tracks even if they are not currently playing.


Why Audacious and Not [Player X]?

You picked your player of choice for a reason so it’s worth addressing directly. The short answer is: audtool, and the song change plugin.

Audacious ships with audtool, a command-line control interface that no other Linux audio player currently matches for programmatic depth. MusicLib relies on it for two things:

  1. Rich data accessaudtool gives MusicLib real-time, scriptable access to playback state: current track, position, queue status, playlist contents. This is what makes precise last-played tracking possible. MusicLib can detect when you’ve passed the 50% threshold on a track and log the exact timestamp — not a guess, not a poll interval. No other Linux player exposes this through a stable CLI.

  2. Song Change - The Audacious ‘song change’ plugin allows scripts to be attached directly to the song change event in the player. MusicLib uses this functionality to process program features for display elements, last-played updates, and more.

This isn’t a knock on Elisa, Strawberry, or Clementine. They’re fine players. But none of them offer audtool’s scripting surface. MusicLib is built on that foundation, and replacing it would mean rebuilding the playback tracking and automation layer from scratch. If a future KDE player ever ships an equivalent CLI interface, support can be added. Audacious supports direct ALSA output, bypassing PulseAudio resampling entirely. Combined with floating-point processing and a minimal DSP chain, it delivers bit-perfect playback for listeners who care about source fidelity, so for me it is a perfect fit.


Ratings That Live in the File

When you rate a track in MusicLib, four things happen simultaneously: the database is updated, the POPM (Popularimeter) ID3v2 tag is written directly into the audio file, the updated star image is placed in an output directory for use by conky or other display tool, and baloo indexes the new rating for display in dolphin via the Ratings column. Your ratings survive a database rebuild, a distro reinstall, or a migration to a different tool entirely — because they travel with the file.

Ratings are visible and editable from four places: the MusicLib Library View, the Now Playing strip in the toolbar, the system tray, or directly from Dolphin via a right-click context menu service installed during setup. Global keyboard shortcuts (Ctrl+1 through Ctrl+5) let you rate whatever’s playing without even touching the MusicLib window.


Smart Playlists with Real Variety

The Smart Playlist engine is where MusicLib pulls ahead. It divides your library into five rating groups (1★–5★) and applies a configurable age threshold per group — tracks played more recently than the threshold are excluded from the candidate pool. This means you can make higher rated tracks repeat more frequently. Tracks that clear the threshold are scored by variance: the longer since they last played, the higher their score. This means you can see which rating groups have been passed over too much. You tailor the thresholds to get your preferred mix of each rating group, then MusicLib produces the playlist for you.

Variance totals are summed per group and used as proportional weights. Each selection round draws from the pool proportionally, so rating groups with more long-unplayed tracks get more slots. The higher you set the threshold the lower the variance becomes. For example, if you want fewer one-star tracks to appear, increase the one-star group threshold to a higher number of days between repeats, or vice versa for five-star, and so on.

A rolling artist exclusion window prevents the same artist from appearing back-to-back. A Custom Artist field lets you merge variants like Tom Petty and Tom Petty & The Heartbreakers into a single exclusion identity, so they don’t slip through the window as separate artists. How? Use the “Custom Artist” field. In our example “Petty” could be populated across this field for all the tracks with the name variant.

Even better, you can decide the number of tracks that have to play before the same artist is repeated.

The result: a playlist that produces genuine variety. You can even use this same method to treat specfic sub-genres or other custom categories as a “single artist” for your own variety scheme.


Playback Tracking Across Devices

MusicLib hooks into Audacious via the Song Change plugin and records a precise timestamp to LastTimePlayed whenever you’ve listened to at least 50% of a track (capped between 30 seconds and 4 minutes minimum). That’s your desktop history — exact.

For mobile, the story is more interesting. When you push a new playlist to your phone via KDE Connect using the MusicLib mobile panel, MusicLib looks at the previous playlist, calculates how long it was on the device, and distributes synthetic timestamps across those tracks using an exponential distribution. Tracks played from the desktop during the same window are logged exactly — only the mobile-played get synthesized dates. The result is continuous last-played accounting across both devices, without requiring anything exotic from your phone. You can optionally bypass the synthetic timestamps if you prefer.

Both Android and iOS are supported via KDE Connect.


Integrated CD Ripping via K3b

When K3b is installed, MusicLib takes ownership of its rip configuration. The setup wizard detects your predominant library format (MP3, Ogg Vorbis, or FLAC), seeds the default output format accordingly, and generates a managed k3brc that is deployed to K3b before every rip session. If you have an existing k3b configuration, you can import it into MusicLib. You configure format, bitrate/quality, error correction mode, and sector retry count from the MusicLib CD Ripping Panel — K3b is always ready with the right settings when it opens.

A drift detection system watches for settings changes made directly inside K3b and offers to either import them back into MusicLib or restore MusicLib’s managed profile — keeping both tools in sync.


Tag Management Built In

MusicLib ships a full tag maintenance suite:

  • Tag Clean — Merges ID3v1 into ID3v2.3, strips APE tags, embeds folder.jpg as album art. Three modes: merge, strip, embed-art.
  • Tag Rebuild — Repairs corrupted tags by restoring values from the database, while preserving ReplayGain data and embedded art.
  • Boost Album — Applies ReplayGain loudness targeting via rsgain, album-wide, to a user-specified LUFS target.

Deep KDE Integration

MusicLib lives in the system tray with hover-to-see track info and a right-click menu for direct panel access. It integrates with Dolphin for ratings and context menus. It outputs detail.txt, starrating.png, and artloc.txt to a Conky output directory for desktop widget display. It opens Kid3 directly from the toolbar for the currently playing track, and launches or activates the Dolphin folder for any selected track.

Planned additions include KRunner integration (search and rate from Alt+Space) and a Plasma Widget for panel/desktop display.


Works on Any KDE Distro

MusicLib is Plasma-native but distro-agnostic. Packages are available for:

  • Arch Linux via AUR (yay -S musiclib)
  • Fedora KDE, Ubuntu/Kubuntu/KDE Neon, openSUSE, and Debian via source build and standard package managers

Try It

The project is on GitHub at https://github.com/Harpo3/musiclib. The full user manual is included. Issues, pull requests, and feedback are welcome.

If you’ve been waiting for a KDE-native tool that actually manages a serious local music library — not just plays it — MusicLib might be what you’ve been looking for.