# ncspot
[](https://crates.io/crates/ncspot)
[](https://gitter.im/ncspot/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
[](https://github.com/hrkfdn/ncspot/actions?query=workflow%3ABuild)
[](https://repology.org/project/ncspot/versions)
[](https://snapcraft.io/ncspot)
[](https://snapcraft.io/ncspot)
`ncspot` is a ncurses Spotify client written in Rust using `librespot`. It is
heavily inspired by ncurses MPD clients, such as ncmpc. My motivation was to
provide a simple and resource friendly alternative to the official client as
well as to support platforms that currently don't have a Spotify client, such
as the \*BSDs.
Note that `ncspot` offers features that are legally incompatible with free Spotify
accounts. See [feature comparison](https://support.spotify.com/us/article/premium-plans/)
and [Spotify user guidelines](https://www.spotify.com/us/legal/user-guidelines/).
You **must** have an existing premium Spotify subscription to use `ncspot`.

## Table of Contents
- [ncspot](#ncspot)
- [Table of Contents](#table-of-contents)
- [Resource Footprint Comparison](#resource-footprint-comparison)
- [Installation](#installation)
- [On macOS](#on-macos)
- [On Windows](#on-windows)
- [On Linux](#on-linux)
- [Build](#build)
- [Prerequisites](#prerequisites)
- [Compiling](#compiling)
- [Building a Debian Package](#building-a-debian-package)
- [Audio Backends](#audio-backends)
- [Other Features](#other-features)
- [Key Bindings](#key-bindings)
- [Navigation](#navigation)
- [Playback](#playback)
- [Context Menus](#context-menus)
- [Sharing](#sharing)
- [Queue](#queue)
- [Library](#library)
- [Vim-Like Search Bar](#vim-like-search-bar)
- [Vim-Like Commands](#vim-like-commands)
- [Configuration](#configuration)
- [Custom Keybindings](#custom-keybindings)
- [Proxy](#proxy)
- [Theming](#theming)
- [Track Formatting](#track-formatting)
- [Notification Formatting](#notification-formatting)
- [Cover Drawing](#cover-drawing)
- [Authentication](#authentication)
## Resource Footprint Comparison
Measured using `ps_mem` on Linux during playback:
| Client | Private Memory | Shared Memory | Total |
|---------|----------------|---------------|------------|
| ncspot | 22.1 MiB | 24.1 MiB | 46.2 MiB |
| Spotify | 407.3 MiB | 592.7 MiB | 1000.0 MiB |
## Installation
### On macOS
`ncspot` is available via [Homebrew](https://brew.sh/):
```zsh
brew install ncspot
```
### On Windows
`ncspot` is available via [Scoop](https://scoop.sh/):
```powershell
scoop install ncspot
```
### On Linux
Your distribution may have packaged `ncspot` in its package repository.
If so, simply install using your distribution's package manager - it
is by far the easiest way. If not, you can build from source instead.
See [Build](#build).
In case your package manager does not perform dependency resolution,
here are the runtime dependencies:
- `dbus`, `libncurses`, `libssl`
- `libpulse` (or `portaudio`, if built using the PortAudio backend)
- `libxcb` (if built with the `clipboard` feature)
- `ueberzug` (if built with the `cover` feature)
## Build
### Prerequisites
- A working [Rust installation](https://www.rust-lang.org/tools/install)
- Python 3 (needed for building `rust-xcb` dependency)
On Linux, you also need:
- `pkgconf` (or `pkg-config`)
- Development headers for the [aforementioned runtime dependencies](#on-linux)
- Debian and derivatives:
```sh
sudo apt install libdbus-1-dev libncursesw5-dev libpulse-dev libssl-dev libxcb1-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev
```
- Fedora:
```sh
sudo dnf install dbus-devel libxcb-devel ncurses-devel openssl-devel pulseaudio-libs-devel
```
- Arch and derivatives:
```sh
# headers are included in the base packages
sudo pacman -S dbus libpulse libxcb ncurses openssl
```
### Compiling
Compile and install the latest release with `cargo-install`:
```sh
cargo install ncspot
```
Or clone and build locally:
```sh
git clone https://github.com/hrkfdn/ncspot
cargo build --release
```
**You may need to manually set the audio backend on non-Linux OSes.** See
[Audio Backends](#audio-backends).
For debugging, you can pass a debug log filename and pipe `stderr` to a file:
```sh
RUST_BACKTRACE=full cargo run -- -d debug.log 2> stderr.log
```
#### Building a Debian Package
You can also use `cargo-deb` to build a Debian package
```sh
cargo install cargo-deb
cargo deb
```
You can find the package under `target/debian`.
### Audio Backends
By default `ncspot` is built using the PulseAudio backend. To make it use the
PortAudio backend (e.g. for \*BSD or macOS) or Rodio backend (e.g. for
Windows), you need to compile `ncspot` with the respective features:
```sh
# PortAudio (BSD/macOS)
cargo build --release --no-default-features --features portaudio_backend,pancurses_backend
# Rodio (Windows)
cargo build --release --no-default-features --features rodio_backend,pancurses_backend
```
### Other Features
Here are some auxiliary features you may wish to enable:
| Feature | Default | Description |
|-------------------|---------|--------------------------------------------------------------------------------------------|
| `cover` | off | Add a screen to show the album art. See [Cover Drawing](#cover-drawing). |
| `mpris` | on | Control `ncspot` via dbus. See [Arch Wiki: MPRIS](https://wiki.archlinux.org/title/MPRIS). |
| `notify` | on | Send a notification to show what's playing. |
| `share_clipboard` | on | Ability to copy the URL of a song/playlist/etc. to system clipboard. |
Consult [Cargo.toml](Cargo.toml) for the full list of supported features.
## Key Bindings
The keybindings listed below are configured by default. Additionally, if you
built `ncspot` with MPRIS support, you may be able to use media keys to control
playback depending on your desktop environment settings. Have a look at the
[configuration section](#configuration) if you want to set custom bindings.
### Navigation
| Key | Command |
|-------------------|-------------------------------------------------------------------------------|
| ? | Show help screen. |
| F1 | Queue (See [specific commands](#queue)). |
| F2 | Search. |
| F3 | Library (See [specific commands](#library)). |
| F8 | Album Art (if built with the `cover` feature). |
| / | Open a Vim-like search bar (See [specific commands](#vim-like-search-bar)). |
| : | Open a Vim-like command prompt (See [specific commands](#vim-like-commands)). |
| Escape | Close Vim-like search bar or command prompt. |
| Q | Quit `ncspot`. |
### Playback
| Key | Command |
|-------------------------------|----------------------------------------------------------------|
| Return | Play track or playlist. |
| Space | Queue track or playlist. |
| . | Play the selected item after the currently playing track. |
| P | Move to the currently playing track in the queue. |
| S | Save the currently playing track to your library. |
| D | Remove the currently playing track from your library. |
| Shift+P | Toggle playback (i.e. Play/Pause). |
| Shift+S | Stop playback. |
| Shift+U | Update the library cache (tracks, artists, albums, playlists). |
| < | Play the previous track. |
| > | Play the next track. |
| F | Seek forward by 1 second. |
| Shift+F | Seek forward by 10 seconds. |
| B | Seek backward by 1 second. |
| Shift+B | Seek backward by 10 seconds. |
| - | Decrease volume by 1%. |
| + | Increase volume by 1%. |
| [ | Decrease volume by 5%. |
| ] | Increase volume by 5%. |
| R | Toggle _Repeat_ mode. |
| Z | Toggle _Shuffle_ state. |
### Context Menus
| Key | Command |
|-------------------------------|-----------------------------------------------------------------------------------------------------------|
| O | Open a detail view or context for the **selected item**. |
| Shift+O | Open a context menu for the **currently playing track**. |
| A | Open the **album view** for the selected item. |
| Shift+A | Open the **artist view** for the selected item. |
| M | Open the **recommendations view** for the **selected item**. |
| Shift+M | Open the **recommendations view** for the **currently playing track**. |
| Ctrl+V | Open the context menu for a Spotify link in your clipboard (if built with the `share_clipboard` feature). |
| Backspace | Close the current view. |
When pressing O:
- If the _selected item_ is **not** a track, it opens a detail view.
- If the _selected item_ **is** a track, it opens a context menu with:
- "Artist(s)" (let's you show or (un)follow a track's artist(s))
- "Show Album"
- "Share" (if built with the `share_clipboard` feature)
- "Add to playlist"
- "Similar tracks"
### Sharing
(if built with the `share_clipboard` feature)
| Key | Command |
|-------------------------------|--------------------------------------------------------------------------|
| X | Copy the URL to the **currently selected item** to the system clipboard. |
| Shift+X | Copy the URL to the **currently playing track** to the system clipboard. |
### Queue
| Key | Command |
|------------------------------|--------------------------------------|
| C | Clear the entire queue. |
| D | Delete the currently selected track. |
| Ctrl+S | Delete the currently selected track. |
### Library
| Key | Command |
|--------------|-----------------------------------------|
| D | Delete the currently selected playlist. |
### Vim-Like Search Bar
| Key | Command |
|--------------|-----------------------------|
| n | Previous search occurrence. |
| N | Next search occurrence. |
## Vim-Like Commands
You can open a Vim-style command prompt using :, and close it at any
time with Escape.
The following is an abridged list of the more useful commands. For the full list, see [source code](/src/command.rs).
Note: \ - mandatory arg; [BAR] - optional arg
| Command | Action |
|------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `help` | Show current key bindings. |
| `quit` Aliases: `q`, `x` | Quit `ncspot`. |
| `logout` | Remove any cached credentials from disk and quit `ncspot`. |
| `playpause` Aliases: `pause`, `toggleplay`, `toggleplayback` | Toggle playback. |
| `stop` | Stop playback. |
| `seek` [`+`\|`-`]\