ravachol / kew

A command-line music player
GNU General Public License v2.0
567 stars 21 forks source link
command-line kew linux music music-player player terminal

kew

GitHub license

Listen to music in the terminal.

Example screenshot
Example screenshot running in Konsole: Jenova 7: Lost Sci-Fi Movie Themes.

\ kew (/kjuː/) is a command-line music player for Linux.

Features

Installing

Packaging status

It's advised, if possible, to install from a package or from a release here on github and not from https://github.com/ravachol/kew.git or the install script, because the main branch can and will be unstable sometimes.

Installing in Debian, Ubuntu

It's available from Ubuntu 24.04, Debian 13.

$ apt install kew

Installing via AUR

On Arch Linux, and Arch-based distributions, kew can be found in the AUR. Install with pamac or an AUR helper like yay:

$ yay kew-git

Or

$ yay kew

Installing via Brew

For Homebrew user, you can install kew with:

$ brew install kew

Installing with quick install script

To quickly install kew, just copy and paste this to your terminal (if you have curl installed):

sudo bash -c "curl https://raw.githubusercontent.com/ravachol/kew/main/install.sh | bash"

Please note that this script might do a system update before installing kew.

Building the project manually

kew dependencies are:

Install FFmpeg, FFTW, Chafa and FreeImage using your distro's package manager. For instance:

apt install ffmpeg libfftw3-dev libopus-dev libopusfile-dev libvorbis-dev git gcc make libchafa-dev libfreeimage-dev libavformat-dev libglib2.0-dev libnotify-dev

Or:

pacman -Syu ffmpeg fftw git gcc make chafa freeimage glib2 opus opusfile libvorbis libnotify

Or (for Fedora for instance):

dnf install -y pkg-config ffmpeg-free-devel fftw-devel opus-devel opusfile-devel libvorbis-devel git gcc make chafa-devel freeimage-devel libavformat-free-devel libnotify-devel libatomic

Notice that for some packages not only the library needs to be installed, but also development packages, for instance libopus-dev or opus-devel.

Then run this (either git clone or unzip a release zip into a folder of your choice):

git clone https://github.com/ravachol/kew.git
cd kew
make
sudo make install

A sixel (or equivalent) capable terminal is recommended, like Konsole or kitty, to display images properly.

For a complete list of capable terminals, see this page: Sixels in Terminal.

LibNotify is (should be) optional

By default, the build system will automatically detect if libnotify is available and include it and enable notifications if found.

Uninstalling

If you installed kew manually, simply run:

sudo make uninstall

Usage

In case you don't have a "Music" folder in your home folder, the first thing to do is to tell kew the path to your music library (you only need to do this once):

kew path "/home/joe/Musik/"

Now run kew and provide a partial name of a track or directory:

kew cure great

This command plays all songs from "The Cure Greatest Hits" directory, provided it's in your music library.

kew returns the first directory or file whose name matches the string you provide. It works best when your music library is organized in this way: artist folder->album folder(s)->track(s).

Some Examples:

kew (starting kew with no arguments opens the library view where you can choose what to play)

kew all (plays all songs, up to 20 000, in your library, shuffled)

kew albums (plays all albums, up to 2000, randomly one after the other)

kew moonlight son (finds and plays moonlight sonata)

kew moon (finds and plays moonlight sonata)

kew beet (finds and plays all music files under "beethoven" directory)

kew dir <album name> (sometimes it's necessary to specify it's a directory you want)

kew song <song> (or a song)

kew list <playlist> (or a playlist)

kew shuffle <album name> (shuffles the playlist)

kew artistA:artistB:artistC (plays all three artists, shuffled)

kew --help, -? or -h

kew --version or -v

kew --nocover

kew --noui (completely hides the UI)

kew -q <song>, --quitonstop (exits after finishing playing the playlist)

kew -e <song>, --exact (specifies you want an exact (but not case sensitive) match, of for instance an album)

kew . loads kew.m3u

Put single-quotes inside quotes "guns n' roses"

Key Bindings

Configuration

kew will create a config file, kewrc, in a kew folder in your default config directory for instance ~/.config/kew. There you can change key bindings, number of bars in the visualizer and whether to use the album cover for color, or your regular color scheme (default). You can also change the default color of the app here. To edit this file please make sure you quit kew first.

License

Licensed under GPL. See LICENSE for more information.

Attributions

kew makes use of the following great open source projects:

Chafa by Petter Jansson - https://hpjansson.org/chafa/

FFmpeg by FFmpeg team - https://ffmpeg.org/

FFTW by Matteo Frigo and Steven G. Johnson - https://www.fftw.org/

Libopus by Opus - https://opus-codec.org/

Libvorbis by Xiph.org - https://xiph.org/

Miniaudio by David Reid - https://github.com/mackron/miniaudio

Img_To_Txt by Danny Burrows - https://github.com/danny-burrows/img_to_txt

Comments? Suggestions? Send mail to kew-music-player@proton.me.