aboutsummaryrefslogtreecommitdiff
path: root/scripts/media_print_spotify_info.sh
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fl.fischer@fau.de>2016-02-23 13:09:57 +0100
committerFlorian Fischer <florian.fl.fischer@fau.de>2016-02-23 13:09:57 +0100
commitca409ba71df438f97cc3202751e8e60a0748af78 (patch)
treef8f3e3a0d97f01a3f86a1e27b5953e0dd702ede8 /scripts/media_print_spotify_info.sh
parent15f23b0630476d1b83d629bca01e1a7f332c84ff (diff)
downloaddotfiles-ca409ba71df438f97cc3202751e8e60a0748af78.tar.gz
dotfiles-ca409ba71df438f97cc3202751e8e60a0748af78.zip
improve media_status
+ split spotify metadata printing in external script: media_print_spotify_info.sh + fix broken relative paths + new display hierarchy: 1. spotify playing 2. mpd playing 3. spotify paused (running) 4. mpd paused (running)
Diffstat (limited to 'scripts/media_print_spotify_info.sh')
-rwxr-xr-xscripts/media_print_spotify_info.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/scripts/media_print_spotify_info.sh b/scripts/media_print_spotify_info.sh
new file mode 100755
index 0000000..3171023
--- /dev/null
+++ b/scripts/media_print_spotify_info.sh
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+metadata=$(dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get string:'org.mpris.MediaPlayer2.Player' string:'Metadata')
+
+artist=$(echo "$metadata" | egrep -A 2 "artist" | egrep -v "artist" | egrep -v "array" | cut -b 27- | cut -d '"' -f 1 | egrep -v ^$)
+
+title=$(echo "$metadata" | egrep -A 1 "title" | egrep -v "title" | cut -b 44- | cut -d '"' -f 1| egrep -v ^$)
+
+echo $artist - $title