Home

Awesome

tap

tap is an audio player for the terminal. Jump to any album in your library with fuzzy-finder shortcuts!

Quick links: Bindings, Installation.

<img src="https://github.com/timdubbins/tap/blob/master/doc/tap_screenshot.png" width="650"/>

How to use

> tap [options] [path]

Run tap in a directory that contains music folders to open a fuzzy-finder, allowing you to select an album to play. Playback starts on selection and you can return to the fuzzy-finder by pressing Tab:

> cd ~/path/to/my_music
> tap

To open a player without the fuzzy-finder provide a path to an audio file or album:

> tap ~/path/to/my_album

path can be a file or directory. If it is omitted the current directory is used.

OptionDescription
-a --automateRun an automated player without the TUI. Quit with Enter.
-d --defaultRun from the default directory, if set.
-p --printPrint the path of the default directory, if set.
-s --set-defaultSet path as the default directory. This can significantly reduce the time it takes to load this directory. See Notes.
-e --excludeExclude all directories that don't contain audio files.
-b --term-bgUse the terminal background color.
-c --term-colorUse the terminal background and foreground colors only.
--color <COLOR>Set colors using <NAME>=<HEX>. See Notes for available names.

Bindings

<details open> <summary><b>Keyboard</b></summary> <br>
GlobalKeybindingIncludes
fuzzy searchTab<i>all folders</i>
depth searchF1...F4<i>folders at depth 1...4</i>
filtered searchA...Z<i>artists beginning with A...Z</i>
artist searchCtrl + a<i>all artists, sorted alphabetically</i>
album searchCtrl + s<i>all albums, sorted alphabetically</i>
parent searchCtrl + p<i>folders up one level</i>
previous album-
random album=
open file managerCtrl + oSee Notes.
PlayerKeybinding
play or pauseh or <kbd></kbd> or Space
nextj or <kbd></kbd>
previousk or <kbd></kbd>
stopl or <kbd></kbd> or Enter
step forward.
step backward,
seek to sec0...9 + "
seek to min0...9 + '
randomr
volume up]
volume down[
show volumev
mutem
go to first trackgg
go to last trackCtrl + g
go to track number0...9 + g
help?
quitq
FuzzyKeybinding
clear searchCtrl + u
cancel searchEsc
page upCtrl + h or PgUp
page downCtrl + l or PgDn
random pageCtrl + z
</details> <details> <summary><b>Mouse</b></summary> <br>
GlobalKeybinding
fuzzy searchMiddle Button
PlayerKeybindingWhere
play or pauseLeft Button<i>Outside playlist</i>
select trackLeft Button<i>Inside playlist</i>
seekLeft Button Hold<i>Inside progress bar<i>
volumeScroll<i>Outside playlist</i>
next / previousScroll<i>Inside playlist</i>
stopRight Button<i>Anywhere</i>
FuzzyKeybinding
cancel searchRight Button
scrollScroll
selectLeft Button
</details>

Installation

<details> <summary><b>macOS</b></summary> <br> You can install with <a href="https://brew.sh/">Homebrew</a>:
> brew install timdubbins/tap/tap
> tap --version
0.4.11
</details> <details> <summary><b>Arch Linux</b></summary> <br>

You can install with an <a href="https://wiki.archlinux.org/title/AUR_helpers">AUR helper</a>, such as <a href="https://github.com/Jguer/yay">yay</a>:

> yay -S tap
> tap --version
0.4.11

The AUR package is available <a href="https://aur.archlinux.org/packages/tap">here</a>. <br>

</details> <details> <summary><b>Debian</b> (or a Debian derivative, such as <b>Ubuntu</b>)</summary> <br>

You can install with a binary <code>.deb</code> file provided in each <a href="https://github.com/timdubbins/tap/releases/tag/v0.4.11">tap release</a>:

> curl -LO https://github.com/timdubbins/tap/releases/download/v0.4.11/tap_0.4.11_amd64.deb
> sudo dpkg -i tap_0.4.11_amd64.deb
> tap --version
0.4.11
</details> <details> <summary><b>Rust</b></summary> <br>

To compile from source, first you need a <a href="https://www.rust-lang.org/learn/get-started">Rust installation</a> (if you don't have one) and then you can use <a href="https://github.com/rust-lang/cargo">cargo</a>:

> git clone https://github.com/timdubbins/tap
> cd tap
> cargo install --path .
> tap --version
0.4.11
</details>

The binaries for each release are also available here.

Notes

Supports:

Setting colors:

The following --color example will set a Solarized theme:

--color fg=268bd2,bg=002b36,hl=fdf6e3,prompt=586e75,header=859900,header+=cb4b16,progress=6c71c4,info=2aa198,err=dc322f 

Setting an alias:

It can be useful to create an alias if you set a default directory or want to persist your color scheme. Put something like the following in your shell config (for zsh users this would be your .zshrc):

alias tap="tap -db --color fg=268bd2,bg=002b36,hl=fdf6e3,prompt=586e75,header=859900,header+=cb4b16,progress=6c71c4,info=2aa198,err=dc322f"

Running tap from any directory will now load the cached default path and set the colors to those defined in the alias (as well as setting the background color to use the terminal background). We can still use commands like tap . and tap <PATH> --color fg=ff9999 with this alias.

Setting the default directory:

This will write a small amount of encoded data to ~/.cache/tap. This is the only place that tap will write to and the data is guaranteed to be at least as small as the in-memory data. Changes in the default directory will be updated in ~/.cache/tap the next time it is accessed by tap.

As a benchmark, setting a directory that is 200GB as the default produces a ~/.cache/tap that has size 350KB (equivalent to an mp3 that is 2 seconds long) and decreases the load time by ~6x.

Opening your file manager:

You can open your preferred file manager from within tap with Ctrl + o Requires xdg-open on linux. From the fuzzy-finder this opens the currently selected directory. From the player it opens the parent of the loaded audio file.

Contributing

Suggestions / bug reports are welcome!

Inspired by

Made possible by