File tree Expand file tree Collapse file tree 1 file changed +1
-2
lines changed Expand file tree Collapse file tree 1 file changed +1
-2
lines changed Original file line number Diff line number Diff line change @@ -291,8 +291,7 @@ __np_spotify() {
291291 else
292292 metadata=$( dbus-send --reply-timeout=42 --print-reply --session --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get string:' org.mpris.MediaPlayer2.Player' string:' Metadata' 2> /dev/null)
293293 if [ " $? " -eq 0 ] && [ -n " $metadata " ]; then
294- # TODO how do one express this with dbus-send? It works with qdbus but the problem is that it's probably not as common as dbus-send.
295- state=$( qdbus org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get org.mpris.MediaPlayer2.Player PlaybackStatus)
294+ state=$( dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get string:' org.mpris.MediaPlayer2.Player' string:' PlaybackStatus' | egrep -A 1 " string" | cut -b 26-| cut -d ' "' -f 1| egrep -v ^$)
296295 if [[ $state == " Playing" ]]; then
297296 artist=$( echo " $metadata " | grep -PA2 " string\s\" xesam:artist\" " | tail -1 | grep -Po " (?<=\" ).*(?=\" )" )
298297 track=$( echo " $metadata " | grep -PA1 " string\s\" xesam:title\" " | tail -1 | grep -Po " (?<=\" ).*(?=\" )" )
You can’t perform that action at this time.
0 commit comments