• Stars
    star
    385
  • Rank 111,464 (Top 3 %)
  • Language
    Go
  • License
    MIT License
  • Created almost 3 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Synchronized lyrics in your terminal

sptlrx

Synchronized lyrics in your terminal

Features

  • Compatible with Spotify, MPD, Mopidy and MPRIS.
  • Works well with long lines & Unicode characters.
  • Easy to customize.
  • Allows piping to stdout.
  • Single binary & cross-plaftorm.

Installation

Linux

yay -S sptlrx-bin
nix-env -iA nixos.sptlrx

or if using nixpkgs

nix-env -iA nixpkgs.sptlrx
  • Other
curl -sSL instl.sh/raitonoberu/sptlrx/linux | bash

Windows

iwr instl.sh/raitonoberu/sptlrx/windows | iex

macOS

curl -sSL instl.sh/raitonoberu/sptlrx/macos | bash

You can also download the binary from the Releases page or build it yourself.

Configuration

Config file will be created at the first launch. On Linux it's located in ~/.config/sptlrx/config.yaml. Run sptlrx -h to see the full path.

Show config contents (with descriptions)
### Global settings ###
# Your Spotify cookie. Only needed if you are going to use Spotify as a player.
cookie: ""
# Player that will be used. Possible values: spotify, mpd, mopidy, mpris.
player: spotify
# Host of lyrics API to be used in case the cookie is not provided.
host: lyricsapi.vercel.app
# Whether to ignore errors instead of showing them.
ignoreErrors: true
# Interval of the internal timer. Determines how often the terminal will be updated.
timerInterval: 200
# Interval for checking the position. Doesn't really affect the precision.
updateInterval: 2000

### Style settings ###
style:
  # Horizontal alignment of lines. Possible values: left, center, right.
  hAlignment: center
  # Style of the lines before the current one.
  before:
    # The colors can be either in HEX format, or ANSI 0-255.
    background: ""
    foreground: ""
    bold: true
    italic: false
    undeline: false
    strikethrough: false
    blink: false
    faint: false
  # Style of the current line.
  current:
    # The colors can be either in HEX format, or ANSI 0-255.
    background: ""
    foreground: ""
    bold: true
    italic: false
    undeline: false
    strikethrough: false
    blink: false
    faint: false
  # Style of the lines after the current one.
  after:
    # The colors can be either in HEX format, or ANSI 0-255.
    background: ""
    foreground: ""
    bold: false
    italic: false
    undeline: false
    strikethrough: false
    blink: false
    faint: true

### Pipe settings ###
pipe:
  # Maximum line length. 0 - unlimited.
  length: 0
  # How to handle overflowing strings. Possible values: word, none, ellipsis.
  overflow: word

### MPD settings ###
mpd:
  # MPD server address with port
  address: 127.0.0.1:6600
  # MPD server password (if any)
  password: ""

### Mopidy settings ###
mopidy:
  # Mopidy server address with port
  address: 127.0.0.1:6680

### MPRIS settings ###
mpris:
  # Whitelist of MPRIS players. First available is used if empty.
  players: []

Spotify

# config.yaml
cookie: <your cookie>
player: spotify

If you want to use Spotify as your player or lyrics source, you need to specify your cookie.

  1. Open your browser.
  2. Press F12, open the Network tab and go to open.spotify.com.
  3. Click on the first request to open.spotify.com.
  4. Scroll down to the Request Headers, right click the cookie field and select Copy value.
  5. Paste it to your config.

You can also set the SPOTIFY_COOKIE enviroment variable or pass the --cookie flag.

TREAT YOUR COOKIE LIKE A PASSWORD AND NEVER SHARE IT

MPD

# config.yaml
player: mpd
mpd:
  address: 127.0.0.1:6600
  password: ""

MPD server will be used as a player.

Mopidy

# config.yaml
player: mopidy
mopidy:
  address: 127.0.0.1:6680

Mopidy server will be used as a player.

MPRIS

# config.yaml
player: mpris
mpris:
  players: []

Linux only. System player that supports MPRIS protocol will be used. You can also specify a whitelist of players to use, example: players: [rhythmbox, spotifyd]. Run playerctl -l to get the names.

Information

Source

If you specify your Spotify cookie, the lyrics will be fetched using your account. Otherwise, the API hosted by me will be used.

Piping

Run sptlrx pipe to start printing the current lines to stdout. This can be used in various status bars and other applications.

Flags

You can pass flags to override the style parameters defined in the config. Example:

sptlrx --current "bold,#FFDFD3,#957DAD" --before "104,faint,italic" --after "104,faint"

List of allowed styles: bold, italic, underline, strikethrough, blink, faint. The colors can be either in HEX format, or ANSI 0-255. The first color represents the foreground, the second represents the background.

Run sptlrx --help to see all the flags.

License

MIT License, see LICENSE for additional information.

More Repositories

1

awesome-asian-girls

A curated list of websites with photosets of Asian girls.
Python
27
star
2

lyricsapi

Go package and server app for retrieving time-stamped lyrics from Spotify.
Go
25
star
3

ytmusic

Go library for searching on YouTube Music.
Go
19
star
4

rutracker-api

(WIP) An easy-to-use package for finding torrents on Rutracker.org
Python
11
star
5

ytsearch

🔎 Go library for searching on YouTube. Without YouTube Data API.
Go
11
star
6

realmusicbot

Your own Telegram bot for playing music from YouTube.
Python
10
star
7

vimego

Search, download Vimeo videos and retrieve metadata in Go.
Go
8
star
8

wails-svelte-template

A Wails template based on Svelte
JavaScript
7
star
9

ruobr_api

Python модуль для доступа к API электронного дневника Кемеровской области (cabinet.ruobr.ru API wrapper)
Python
7
star
10

archcraft-xfce-gruvbox

Gruvbox theme for Archcraft XFCE
Shell
6
star
11

kalliope_neuron_spotify

Make Kalliope play Spotify music and control playback
Python
5
star
12

round-icons

A set of round icons with a simple unified style.
Python
5
star
13

ruobr_vkbot

Бот ВКонтакте для взаимодействия с электронным дневником.
Python
4
star
14

mask_recognizer_2000

An app that checks whether you are wearing a mask or not
Python
4
star
15

bus42app

Расписание общественного транспорта для жителей Кемеровской области
Dart
3
star
16

raitonoberu

About me
3
star
17

Last2VK

Last.fm "Now Playing" broadcast to VK status message
Python
3
star
18

riverpipe

Make bars for River with ease!
Go
2
star
19

plugin.video.2x2

Kodi add-on for the Russian TV channel "2x2"
Python
1
star