Henrik Friedrichsen 36159900fd dependency updates
Squashed commit of the following:

commit be5808240d03ae8d3a0238c6597d431b317796e0
Merge: cb0cc67 8103734
Author: Henrik Friedrichsen <henrik@affekt.org>
Date:   Mon Oct 19 00:27:21 2020 +0200

    Merge remote-tracking branch 'origin/dependabot/cargo/toml-0.5.7' into deps

commit cb0cc67e92d89516d52686a67dff7ff5c04d5495
Merge: b8eeb1a 68856c6
Author: Henrik Friedrichsen <henrik@affekt.org>
Date:   Mon Oct 19 00:27:12 2020 +0200

    Merge remote-tracking branch 'origin/dependabot/cargo/strum_macros-0.19.4' into deps

commit b8eeb1ab1e105886caec337d4f956b0ec5fc4296
Merge: d490fce 9139195
Author: Henrik Friedrichsen <henrik@affekt.org>
Date:   Mon Oct 19 00:27:05 2020 +0200

    Merge remote-tracking branch 'origin/dependabot/cargo/serde-1.0.117' into deps

commit d490fce784d43eb54615edaae23a2d6bfaf64cc5
Merge: ee72425 51ecfbc
Author: Henrik Friedrichsen <henrik@affekt.org>
Date:   Mon Oct 19 00:26:53 2020 +0200

    Merge remote-tracking branch 'origin/dependabot/cargo/regex-1.4.1' into deps

commit ee72425de2ee0137a383c0908ae56d469b9d735e
Author: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Date:   Sun Oct 18 22:19:04 2020 +0000

    Bump crossbeam-channel from 0.4.4 to 0.5.0

    Bumps [crossbeam-channel](https://github.com/crossbeam-rs/crossbeam) from 0.4.4 to 0.5.0.
    - [Release notes](https://github.com/crossbeam-rs/crossbeam/releases)
    - [Changelog](https://github.com/crossbeam-rs/crossbeam/blob/master/CHANGELOG.md)
    - [Commits](https://github.com/crossbeam-rs/crossbeam/compare/crossbeam-channel-0.4.4...crossbeam-channel-0.5.0)

    Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

commit 51ecfbcb26f2931c74ccacd408224cefdccd9130
Author: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Date:   Sun Oct 18 22:18:44 2020 +0000

    Bump regex from 1.3.9 to 1.4.1

    Bumps [regex](https://github.com/rust-lang/regex) from 1.3.9 to 1.4.1.
    - [Release notes](https://github.com/rust-lang/regex/releases)
    - [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md)
    - [Commits](https://github.com/rust-lang/regex/compare/1.3.9...1.4.1)

    Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

commit 68856c6b42fd4411218a906b603c658bf4634038
Author: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Date:   Sun Oct 18 22:18:17 2020 +0000

    Bump strum_macros from 0.17.1 to 0.19.4

    Bumps [strum_macros](https://github.com/Peternator7/strum) from 0.17.1 to 0.19.4.
    - [Release notes](https://github.com/Peternator7/strum/releases)
    - [Changelog](https://github.com/Peternator7/strum/blob/master/CHANGELOG.md)
    - [Commits](https://github.com/Peternator7/strum/commits)

    Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

commit 81037349e712317a1cd2b47c424e58535e97b3fd
Author: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Date:   Sun Oct 18 22:18:03 2020 +0000

    Bump toml from 0.5.6 to 0.5.7

    Bumps [toml](https://github.com/alexcrichton/toml-rs) from 0.5.6 to 0.5.7.
    - [Release notes](https://github.com/alexcrichton/toml-rs/releases)
    - [Commits](https://github.com/alexcrichton/toml-rs/compare/0.5.6...0.5.7)

    Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

commit 91391958b2d1d46e4038ceb16c84219a8ce5c373
Author: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Date:   Sun Oct 18 22:17:34 2020 +0000

    Bump serde from 1.0.116 to 1.0.117

    Bumps [serde](https://github.com/serde-rs/serde) from 1.0.116 to 1.0.117.
    - [Release notes](https://github.com/serde-rs/serde/releases)
    - [Commits](https://github.com/serde-rs/serde/compare/v1.0.116...v1.0.117)

    Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-10-19 00:30:47 +02:00
2020-10-19 00:30:47 +02:00
2020-10-19 00:30:47 +02:00
2019-03-13 13:56:30 +01:00

ncspot

Crates.io Gitter Build

Packaging status

ncspot ncspot

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.

Search

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

Requirements

  • Rust
  • Python 3 (needed for building rust-xcb dependency)
  • libpulse-dev (or portaudio-dev, if you want to use the PortAudio backend)
  • libncurses-dev and libssl-dev
  • libdbus-1-dev
  • libxcb + development headers (for clipboard access)
  • A Spotify premium account
  • pkg-config

On Debian based systems you need following packages for development headers:

sudo apt install libncursesw5-dev libdbus-1-dev libpulse-dev libssl-dev libxcb1-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev

For Fedora, these dependencies are required:

dnf install pulseaudio-libs-devel libxcb-devel openssl-devel ncurses-devel dbus-devel

Usage

  • Install the latest ncspot release using cargo install ncspot
    • or build it yourself using cargo build --release
    • both approaches require a working Rust installation
  • For debugging, pass a debug log filename, e.g. ncspot -d debug.log

Audio backends

By default ncspot is built using the Rodio backend. To make it use the PortAudio backend (e.g. for *BSD or macOS), you need to recompile ncspot with the portaudio_backend feature:

  • cargo run --no-default-features --features portaudio_backend,cursive/pancurses-backend

Key Bindings

The keybindings listed below are configured by default. Additionally, if you run 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 if you want to set custom bindings.

  • ? show help screen
  • Navigate through the screens using the F-keys:
    • F1: Queue
      • c clears the entire queue
      • d deletes the currently selected track
      • Ctrl-s opens a dialog to save the queue to a playlist
    • F2: Search
    • F3: Library
      • d deletes the currently selected playlist
  • Tracks and playlists can be played using Return and queued using Space
  • . will play the selected item after the currently playing track
  • p will move to the currently playing track in the queue
  • s will save, d will remove the currently selected track to/from your library
  • o will open a detail view or context menu for the selected item
  • Shift-o will open a context menu for the currently playing track
  • a will open the album view for the selected item
  • A will open the artist view for the selected item
  • Ctrl-v will open the context menu for a Spotify link in your clipboard
  • Backspace closes the current view
  • Shift-p toggles playback of a track
  • Shift-s stops a track
  • Shift-u updates the library cache (tracks, artists, albums, playlists)
  • < and > play the previous or next track
  • f and b to seek forward or backward
  • Shift-f and Shift-b to seek forward or backward in steps of 10s
  • - and + decrease or increase the volume
  • r to toggle repeat mode
  • z to toggle shuffle playback
  • q quits ncspot
  • x copies a sharable URL of the song to the system clipboard
  • Shift-x copies a sharable URL of the currently selected item to the system clipboard

Use / to open a Vim-like search bar, you can use n and N to go for the next/previous search occurrence, respectivly.

You can also open a Vim style commandprompt using :, the following commands are supported:

  • quit: Quit ncspot
  • toggle: Toggle playback
  • stop: Stop playback
  • previous/next: Play previous/next track
  • clear: Clear playlist
  • share [current | selected]: Copies a sharable URL of either the selected item or the currernt song to the system clipboard

The screens can be opened with queue, search, playlists and log, whereas search can be supplied with a search term that will be entered after opening the search view.

To close the commandprompt at any time, press esc.

Configuration

Configuration is saved to ~/.config/ncspot/config.toml. To reload the configuration during runtime use the reload statement in the command prompt :reload.

Possible configuration values are:

  • use_nerdfont: Turn nerdfont glyphs on/off <true/false>
  • theme: Set a custom color palette (see below)
  • backend: Audio backend to use, run ncspot -h for a list of devices
  • backend_device: Audio device string to configure the backend
  • audio_cache: Enable or disable caching of audio files, on by default <true/false>
  • volnorm: Enable or disable volume normalization, off by default <true/false>
  • volnorm_pregain: Normalization pregain to apply (if enabled)
  • default_keybindings: If disabled, the default keybindings are discarded, off by default <true/false>
  • notify: Enable or disable desktop notifications, off by default <true/false>
  • bitrate: The audio bitrate to use for streaming, can be 96, 160, or 320 (default is 320)
  • album_column: Show album column for tracks, on by default <true/false>

Keybindings can be configured in [keybindings] section in config.toml, e.g. as such:

[keybindings]
"Shift+i" = "seek +10000"

See the help screen by pressing ? for a list of possible commands.

ncspot will respect system proxy settings defined via the http_proxy environment variable.

Initial state

The initial state can be specified in the configuration. It allows for example enabling shuffle per default. Following entries can be added to the configuration file:

[saved_state]
volume = 80
repeat = "track"
shuffle = true
  • volume needs to be an integer value between 0 and 100
  • repeat can be "track", "playlist" or any other value which defaults to no
  • shuffle must be "true" or "false"

Theming

Theme generator by @vaarad.

The color palette can be modified in the configuration. For instance, to have ncspot match Spotify's official client, you can add the following entries to the configuration file:

[theme]
background = "black"
primary = "light white"
secondary = "light black"
title = "green"
playing = "green"
playing_selected = "light green"
playing_bg = "black"
highlight = "light white"
highlight_bg = "#484848"
error = "light white"
error_bg = "red"
statusbar = "black"
statusbar_progress = "green"
statusbar_bg = "green"
cmdline = "light white"
cmdline_bg = "black"
search_match = "light red"

More examples can be found in pull request https://github.com/hrkfdn/ncspot/pull/40.

Description
No description provided
Readme 3.9 MiB
Languages
Rust 100%