projects
/
spot-check-nix.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5b73abf
)
Add script for playback status
master
author
Jacob Casper
<dev@jacobcasper.com>
Wed, 22 Jan 2020 18:07:51 +0000
(12:07 -0600)
committer
Jacob Casper
<dev@jacobcasper.com>
Wed, 22 Jan 2020 18:07:51 +0000
(12:07 -0600)
spot_playing
[new file with mode: 0755]
patch
|
blob
diff --git a/spot_playing
b/spot_playing
new file mode 100755
(executable)
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