Skip to main content

Get the current spotify status from cmd line

Project description

i3blocks screenshot

Requirements

Requires OS level python dbus package:

λ sudo apt install python[3]-dbus

Installation

Install with pip:

λ pip install spotify-dbus-status

Usage

Enter spotify-dbus-status at the command line:

λ spotify-dbus-status
Flying Lotus - Zodiac Shit - Cosmogramma

The (–all) flag is implicit if nothing is specified:

λ spotify-dbus-status --all
Flying Lotus - Zodiac Shit - Cosmogramma

Get specific data:

λ spotify-dbus-status --album
Cosmogramma

λ spotify-dbus-status --artist
Flying Lotus

λ spotify-dbus-status --song
Zodiac Shit

Ordered output:

λ spotify-dbus-status --song --artist
Zodiac Shit - Flying Lotus

Custom seperator:

λ spotify-dbus-status --song --album --sep=", "
Zodiac Shit, Cosmogramma

Provide Template string:

λ spotify-dbus-status --template="[Artist: {artist} | Album: {album}]"
[Artist: Flying Lotus | Album: Cosmogramma]

As JSON:

λ spotify-dbus-status --format=json
{"album": "Cosmogramma", "artist": "Flying Lotus", "song": "Zodiac Shit"}

You can then parse by piping into jq:

λ spotify-dbus-status --format=json | jq -r '.artist + " - " + .song'
Flying Lotus - Zodiac Shit

i3blocks Integration

Add the following section (or similar) to you i3blocks.conf:

[spotify]
label=
command=spotify-dbus-status --template="{artist} - {song}"
interval=2
signal=10
color=#24CF5F

Contributor Thanks

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

spotify-dbus-status-0.1.6.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

spotify_dbus_status-0.1.6-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

Details for the file spotify-dbus-status-0.1.6.tar.gz.

File metadata

  • Download URL: spotify-dbus-status-0.1.6.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.1

File hashes

Hashes for spotify-dbus-status-0.1.6.tar.gz
Algorithm Hash digest
SHA256 3779f4863e4fd03aecc30a82305a40b04cc1dddaeb97b4d59e6c2fd1098d5cc4
MD5 1610df3d4b7afcde3fcc817cf4f467c8
BLAKE2b-256 f6b7f091d8eab9da6ee495afd41af82b7a03aeea874c3365f1dba8844e2b0b40

See more details on using hashes here.

File details

Details for the file spotify_dbus_status-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: spotify_dbus_status-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 3.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.1

File hashes

Hashes for spotify_dbus_status-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 682882e097dcf03b5db9ab94a818ba8a76d0be70d6fed1b36af97711163c9a6b
MD5 aad1c4522f43e4b3c1cd9150bc545b4e
BLAKE2b-256 8666f7b278ce695d3664f308d9375b8032c53011ef09491dc294facbbfb5f429

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page