pointfichiers/bar/eww/scripts/get-music-info

15 lines
465 B
Text
Raw Normal View History

2024-09-20 18:45:02 +02:00
#!/usr/bin/env dash
2024-02-19 15:50:08 +01:00
info (){
title=$(playerctl metadata xesam:title 2> /dev/null)
artist=$(playerctl metadata xesam:artist 2> /dev/null)
artUrl=$(playerctl metadata mpris:artUrl 2> /dev/null)
status=$(playerctl status 2> /dev/null)
echo "{\"title\": \"${title}\", \"artist\": \"${artist}\", \"artUrl\": \"${artUrl}\", \"status\": \"${status}\"}"
}
info
dbus-monitor "path=/org/mpris/MediaPlayer2,member=PropertiesChanged" | while read -r line; do
info
done