From 9e6e83dd22472d59255aefab8dd59976ecf9c4b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20K=C3=B6rber?= Date: Mon, 29 Jan 2018 12:47:13 +0100 Subject: [PATCH] Add spotify-control script --- i3/scripts/spotify-control | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 i3/scripts/spotify-control diff --git a/i3/scripts/spotify-control b/i3/scripts/spotify-control new file mode 100755 index 0000000..05618ad --- /dev/null +++ b/i3/scripts/spotify-control @@ -0,0 +1,20 @@ +#!/bin/bash + +case "$1" in +toggle) + cmd="PlayPause" + ;; +next) + cmd="Next" + ;; +previous) + cmd="Previous" + ;; +*) + echo "wrong argument $1" + exit 1 + ;; +esac + +dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player."${cmd}" +~/.i3/scripts/bar-update spotify