Skip to main content

lastfm-now

Show what a user is currently playing.

I created this to be displayed on my i3 status bar. Like this:

i3 Status Bar

Basic Usage

In order for this to work you will require a lastfm api key. Grab one here

Install from pypi

pip3 install lastfm-now

Install from source

cd lastfm-now-playing
pip3 install .

Run

lastfm-now will read the api key from LASTFM_API_KEY environment variable. It can also be specified on the command line. It can also read the username from LASTFM_USERNAME environment variable or can be specified on the commandline.

Environment variables - example

export LASTFM_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxx 
export LASTFM_USERNAME=bob123
lastfm-now

Command line options - example

lastfm-now --apikey xxxxxxxxxxxxxxxxxxxxxxxx <username> 

CLI options

  -a, --apikey TEXT     Lastfm API key
  --log TEXT            Minimum log level to display [debug, info, warning, error, critical]
  --latch / --no-latch  Show most recently played track, even if not currently playing
  --prechars TEXT       Characters to be displayed before the output
  --postchars TEXT      Characters to be displayed after the output
  --help                Show this message and exit.

i3 Status Bar

I am currently using i3status-rs as its nice and simple.

Here is how I configure it:

~/.xsessionrc

Use ~/.xsessionrc to export API key. This ensures the API key is available when X starts.

export LASTFM_API_KEY=xxxxxxxxxxxxxxxxxxxxx

i3status-rs config

[[block]]
block = "custom"
command = "lastfm-now adamcathersides --prechars '♫ '"
interval = 5

i3 config file


bar {
        status_command i3status-rs ~/.config/i3/status.toml
}

Metadata

Release files for lastfm-now 0.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lastfm-now 0.0.3
File Size Uploaded
lastfm-now-0.0.3.tar.gz 3.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for lastfm-now 0.0.3
File Interpreter ABI Platform
lastfm_now-0.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 6.3 kB

Release files / lastfm-now-0.0.3.tar.gz

Download URL lastfm-now-0.0.3.tar.gz
Size 3.1 kB
Tags Source
SHA-256 checksum
How to use checksums
bd70ded2c5926ccd47d8aeb0d121cde7128c1e4147f91c67f1648cd5e9a4be4a
BLAKE2b-256 checksum
How to use checksums
aa7d1465a24d26f885d413ab7630ba65b08de1b91c41e5aa4fc399c73c2fe2ec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.42.0 CPython/3.8.1

Release files / lastfm_now-0.0.3-py3-none-any.whl

Download URL lastfm_now-0.0.3-py3-none-any.whl
Size 3.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
99f9d115764c57076be8952767a71fa3d41a9972eb6fb68f1567230dbfbf2ae3
BLAKE2b-256 checksum
How to use checksums
0ccf55f8a461adbad537a86b67fdce90957a4f571fa0a9b064a1fa3b910eaf26
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.42.0 CPython/3.8.1

Release history Release notifications | RSS feed

This release

0.0.3 This release

2 release files

0.0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page