X-Git-Url: https://git.jacobcasper.com/?p=spot-check-nix.git;a=blobdiff_plain;f=spot_playing;fp=spot_playing;h=d1f2625f5f006ed9162d6f66c1a5d27cc25a9042;hp=0000000000000000000000000000000000000000;hb=75d9f34d0fd6fa2fe0617f903e5bcb1b23361f88;hpb=5b73abf97097f945add4b14dd0418c088cc409f8 diff --git a/spot_playing b/spot_playing new file mode 100755 index 0000000..d1f2625 --- /dev/null +++ b/spot_playing @@ -0,0 +1,6 @@ +#!/bin/sh +dbus-send --print-reply=literal --session \ +--dest=org.mpris.MediaPlayer2.spotify \ +/org/mpris/MediaPlayer2 \ +org.freedesktop.DBus.Properties.Get string:'org.mpris.MediaPlayer2.Player' string:'PlaybackStatus' \ +| awk 'END { if (NR == 0) { exit 1 } } { exit $2 != "Playing" }' # 0 (success exit code) means playing