Readit News logoReadit News
Posted by u/ravachol a year ago
Show HN: kew – A Terminal Music Player for Linuxgithub.com/ravachol/kew...
Hi HN,

I created kew, a music player for the Linux terminal.

This started when I asked myself: what if I could just type something like "play nirvana" in the terminal and have the rest taken care of automatically? That got the ball rolling and I kept adding stuff: covers in ascii and then as sixel images, a playlist view, a visualizer, a library view and finally search.

While kew can be used as a commandline tool, it has evolved into a TUI app.

Here are some example commands:

kew nirvana # Plays all of your Nirvana songs, shuffled

kew nevermind # Plays the "Nevermind" album in order

kew spirit # Plays "Smells Like Teen Spirit"

kew all # Plays all your music, shuffled

kew albums # Plays one album after the other in random order

It works best when your music library is organized like this: Artist/Album(s)/Track(s)

kew is written in C and licensed under GPLv2.

Source and screenshot: https://github.com/ravachol/kew

kunley · a year ago
Apart from all the audio goodies, that's one of the few projects around that has actually working make uninstall.

So much thanks for giving a good example

ravachol · a year ago
You uninstalled it. :(
kunley · a year ago
No, I didn't! But I was happy to see such a makefile target exists and one doesn't need to go through console logs to see wtf was installed, or just shrug and think "yet another project made like it's the center of the universe"
BoingBoomTschak · a year ago
It's is pretty cool, I can feel the energy poured into making your personal computing experience more seamless! Though the first thing I wondered when reading your examples is "how is ambiguity resolved?". Like albums, artists and tracks having the same string or sharing a prefix (search in this specific order, I guess?); or artists having the exact same name.

The aspect I like the most is using the filesystem as a database, since that's what UNIX people should like (and you can use symlinks for more complex cases). In fact, I myself made a music player with that as central philosophy, though it is much more bare/suckless compared to yours: https://git.sr.ht/~q3cpma/mus

Did you consider implementing a simple event system (maybe even IPC) for track and status change? Possibly MPRIS or something simpler. That was the main feature I kept from cmus when creating mus, so that I can easily interact with it through lemonbar and scripts.

ravachol · a year ago
Thank you. To answer your first question, ambiguity isn't resolved unfortunately. When the album has the same name as the artist for instance, I have sometimes resorted to renaming the album name by adding "album" to it. You can however get an exact search by adding -e so that resolves some problems.

Yes, MPRIS is supported.

cdaringe · a year ago
I love the idea. My music is now 50% cloud only, 50% on disk. I mean, its 100% in the cloud, i just have local files for half available. Ive been thinking about self hosting some music provider thingy (or even just supporting ssh via my dyndns-like capability) to my NAS and bringing music back to self owned files. However, it is work to do when the internet is pretty reliable, costs are low, etc.

Those who love this conceptually but have/had cloud music, did you act? How/why?

nvllsvm · a year ago
I used various Subsonic clients for a number of years, but the clients were always lacking. Android clients were buggy or didn't prioritize local caching and I preferred to use mpd+ncmpcpp on my laptop.

I ended up switching to fully-local media after realizing that my 956GB flac+mp3 would be ~159GB when converted to Opus. I now use https://github.com/nvllsvm/harmonize to maintain a 128kbps Opus version of my main library and Syncthing to synchronize it to my phone and laptop.

--- side note, Auxio is the client I'm using on Android with my synced library.

raun1 · a year ago
I host my music on an Unraid box on my home LAN, use Plex+Plexamp to serve and access it, and 1000% recommended Plex+Plexamp. It is, without a doubt, the best music app I've used on a phone, including other self-hosting solutions, local apps like Poweramp, and commercial streaming apps like Spotify. I really can't speak of it highly enough.
reverend_gonzo · a year ago
I have a airsonic (fork of subsonic, which I used for a long time) server running on a vps. I’ve probably had this for coming on 20 years now.

It works phenomenally.

At some point I was going to mirror it locally, but never got around to it.

It is all backed up in dropbox

lunchables · a year ago
I've also been a long time airsonic (and now airsonic-advanced) user for so long I can't even remember, but a couple years ago I switched to navidrome which is also subsonic compatible and it's sooo much nicer.

Use whatever you want! Just wanted to suggest it.

theandrewbailey · a year ago

    sudo bash -c "curl https://raw.githubusercontent.com/ravachol/kew/main/install.sh | bash"
Might as well run unsigned binaries straight from the internet. What is this, Windows?

ravachol · a year ago
Good point. Might be better to just have the commands installing the requirements for the different distros, in the readme.
ravachol · a year ago
done.
shepherdjerred · a year ago
Super weird to bring Windows into this, but, anyway? I actually really like these one liners even if they have greater potential for abuse.
halJordan · a year ago
It's not weird to mention the other os where downloading and blindly double-clicking a naked exe is the standard.
ravachol · a year ago
He's right actually the quick-install script is pretty barbaric.
VyseofArcadia · a year ago
Slick! I love it.

It doesn't fit my use-case very well, though. I'm not saying it needs to, but I'm going to put my use-case out there in case someone is looking for project ideas.

We have oodles of music players on Linux, GUI and terminal. But we have very few choices that

* are optimized for the absurdly, comically large library of someone who has been diligently collecting and organizing music for decades

* collect playback statistics and allow user rating of songs

* that can be used to create smart playlists

I used amarok for years, but it keeps dying and reviving, and I don't trust it to stick around. I then used mpd for years, but while mpd excels at large libraries, the other two requirements have to be implemented client-side, and the experience was always at least a little janky. I currently use Strawberry, but 1) it chugs with a large library, 2) its smart playlists aren't expressive enough, and 3) it is also kind of janky, and I experience frequent crashes.

The only player I've found that really fits my use-case like a glove is MediaMonkey, but I walked away from Microsoft years ago, and I'm not about to go back now just to wrangle my music library.

sandreas · a year ago
Nice, thanks for sharing your thoughts. Currently, I use navidrome[1], which not really is a player but more a music server, but since it supports the "subsonic" protocol, you can use native apps to connect and manage your stuff (substreamer for android / iOS is all I really need but navidrome also comes with a handy web interface). It also has support for json based smart playlists[2].

1: https://www.navidrome.org/ 2: https://github.com/navidrome/navidrome/issues/1417

worble · a year ago
Just to add an alternative, I'm using Airsonic Advanced[0] as my subsonic server of choice if for only one reason: it properly supports folder navigation. I've ranted about this before (looking at you Jellyfin) but my folder layout is sacred and any media service I use needs to respect it.

For an android client I use tempo[1] which again was one I landed on because pretty much all the other clients didn't support folder lookup either (I think dsub also does but tempo is a lot prettier).

0: https://github.com/kagemomiji/airsonic-advanced

1: https://github.com/CappielloAntonio/tempo

VyseofArcadia · a year ago
That looks like it checks most of my boxes, but I have a personal/philosophical objection to running a service. The objection is, I don't want to[0]. I just want a local application. Not local-first, I want local-only. Just an application.

[0] and also I think it's insane to add that much complexity to something that is single-user.

ravachol · a year ago
Yes, while a comically large music library is supported in principle (kew offers to cache your library if it takes a long time to search through), it might not be entirely suited for it.

As for your other two suggestions those fall outside the scope of kew. kew is supposed to be simple with minimal bloat.

VyseofArcadia · a year ago
I will by trying it out on my laptop which has only a fraction of my library and I don't use often enough to want statistics or smart playlists.
amlib · a year ago
Strawberry is a pretty solid Amarok fork that is picking up steam. They are now releasing multiple releases a month and in my opinion it's a great "fully featured", gui first, easy to use player that handles large libraries well.
opan · a year ago
Amarok? Not Clementine? Or was that also an Amarok fork?
jakobdabo · a year ago
I see what you've done there!

        int randomNumber = getRandomNumber(1, 808);
        if (randomNumber == 808)
                printGlimmeringText(text, nerdFontText, lastRowColor);
Nice project!

ravachol · a year ago
That's an easter egg! Gj! You're the first that has mentioned it.
sigmonsays · a year ago
Trying to nix run it I get a ton of insecure warnings and it lists the CVEs

Is this a nix thing (i'm unsure what freeimage-unstable is)

       error: Package ‘freeimage-unstable-2021-11-01’ in /nix/store/20yis5w6g397plssim663hqxdiiah2wr-source/pkgs/development/libraries/freeimage/default.nix:72 is marked as insecure, refusing to evaluate.


       Known issues:
        - CVE-2021-33367
        - CVE-2021-40262
        - CVE-2021-40263
        - CVE-2021-40264
        - CVE-2021-40265
        - CVE-2021-40266
        - CVE-2023-47992
        - CVE-2023-47993
        - CVE-2023-47994
        - CVE-2023-47995
        - CVE-2023-47996

ravachol · a year ago
FreeImage is used by Chafa to display the covers in the terminal.

The version of kew packaged for Nix is very old: v1.5.2. We're at version 2.8.2. So it's more than a year old, from very early on in the project.

ravachol · a year ago
"Buffer Overflow vulnerability in Freeimage v3.18.0 allows attacker to cause a denial of service via a crafted JXR file."

I don't know how relevant these vulnerabilities are to kew, which isn't run across the network in any way, it just reads your local files.

Thank you for bringing this to light. I don't know how feasible it is to use something other than freeimage though, gonna have to investigate.

joveian · a year ago
It is still relevant because sometimes those local files come from the network and aren't trusted.

Looks like a nice project, I like the terminal album art display :).

smartmic · a year ago
I use mpd with various clients, mostly also from terminal. mpd support would be great - and actually the only reason for me to try it out.

https://www.musicpd.org/