summaryrefslogtreecommitdiffstats
path: root/toggle-music
diff options
context:
space:
mode:
Diffstat (limited to 'toggle-music')
-rwxr-xr-xtoggle-music8
1 files changed, 8 insertions, 0 deletions
diff --git a/toggle-music b/toggle-music
new file mode 100755
index 0000000..c491b76
--- /dev/null
+++ b/toggle-music
@@ -0,0 +1,8 @@
+#!/bin/bash
+
+if pgrep spotify &>/dev/null; then
+ mpc pause
+ dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause
+else
+ mpc toggle
+fi