Monitors what is currently playing in your Clementine music player, by hooking into the relevant dbus signals to detect state change.
(This is the first python script I've ever written.)
Whenever the state of the player changes, this script outputs a single line of pipe (|) delimited fields indicating the state and song info.
When the player is stopped, it will write the single field:
If a song is currently playing, it will write the following fields:
- State, which is either
- The track number.
- The title of the song.
- The artist for the song.
- The album for the song.
- The duration of the song in minutes and seconds (
- The full path and file name.
- File containing the current cover image (if available).
playing|20|So Was Red|Thomas Newman|The Shawshank Redemption|2:46|/path/to/music/Thomas Newman/The Shawshank Redemption/20 So Was Red.mp3|/tmp/clementine-art-l10931.jpg