d9e94d99c1
In order to save some CPU
15 lines
477 B
Bash
Executable file
15 lines
477 B
Bash
Executable file
#!/usr/bin/env dash
|
|
|
|
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
|
|
sleep 0.1
|
|
done
|