https://github.com/evmcl/clementinemonitor
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:
stopped
If a song is currently playing, it will write the following fields:
- State, which is either
playing
orpaused
. - 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 (
m:ss
). - The full path and file name.
- File containing the current cover image (if available).
e.g. 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
(MIT License)
P.S. If you are unfamiliar with Clementine you can read a little review I wrote detailing why I think it is the best desktop music player around.