Display now playing from lastfm
Project description
lastfm-now
Show what a user is currently playing.
I created this to be displayed on my i3 status bar. Like this:
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 variables. It can also be specified on the command line.
Environment variables - example
export LASTFM_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxx
lastfm-now <username>
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
}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
lastfm-now-0.0.2.tar.gz
(3.0 kB
view hashes)
Built Distribution
Close
Hashes for lastfm_now-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f88e2b6a1b814972344023e1b1d2490c2cf0427cf921b4690d82525511cc8f27 |
|
MD5 | f8d9f836303a0134864ace4ba5c3f05b |
|
BLAKE2b-256 | 73f0f961a7f41c503fd4820d5195970dfbab1dbadd7c424550b279084b7d76e4 |