Add script for playback status
[spot-check-nix.git] / spot_playing
CommitLineData
75d9f34d
JC
1#!/bin/sh
2dbus-send --print-reply=literal --session \
3--dest=org.mpris.MediaPlayer2.spotify \
4/org/mpris/MediaPlayer2 \
5org.freedesktop.DBus.Properties.Get string:'org.mpris.MediaPlayer2.Player' string:'PlaybackStatus' \
6| awk 'END { if (NR == 0) { exit 1 } } { exit $2 != "Playing" }' # 0 (success exit code) means playing