summaryrefslogtreecommitdiff
path: root/src/musefetch
diff options
context:
space:
mode:
Diffstat (limited to 'src/musefetch')
-rw-r--r--src/musefetch/__main__.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/musefetch/__main__.py b/src/musefetch/__main__.py
index d6792c5..46fb4c4 100644
--- a/src/musefetch/__main__.py
+++ b/src/musefetch/__main__.py
@@ -30,11 +30,15 @@ def main():
cover = from_url(metadata.get("mpris:artUrl", ""))
cover.height = 15
+ duration = player.Get("org.mpris.MediaPlayer2.Player", "Position") / 1_000_000
+ length = metadata.get("mpris:length", 0) / 1_000_000
+
songdata = [
f"Title: {metadata.get('xesam:title', 'Unknown')}",
f"Artist(s): {', '.join(metadata.get('xesam:artist', ['Unknown']))}",
f"Album: {metadata.get('xesam:album', 'Unknown')}",
f"Playing: {playing}",
+ f"{int(duration // 60)}:{int(duration % 60):02d} / {int(length // 60)}:{int(length % 60):02d}",
]
img_lines = str(cover).splitlines()