Script for outputting now scrobbling track to polybar
Modified idea from 0nse
- Install dependencies:
pip install -r requirements.txt - Fetch a Last.fm API key: go wild m8
- Export your key and username as environment variables (e.g. in your shell rc file):
export LASTFM_API_KEY="your-api-key"
export LASTFM_USERNAME="your-lastfm-username"
Example snippet from polybar config file:
[module/now_playing]
type = custom/script
exec = "python3 $HOME/.scripts/now_scrobbling.py"
tail = true
format = <label>
format-prefix = ""
format-prefix-foreground = ${colors.foreground}
label = %output:0:50%
