summaryrefslogtreecommitdiffhomepage
path: root/bin/sp-hook.sh
diff options
context:
space:
mode:
Diffstat (limited to 'bin/sp-hook.sh')
-rwxr-xr-xbin/sp-hook.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/bin/sp-hook.sh b/bin/sp-hook.sh
new file mode 100755
index 0000000..feed245
--- /dev/null
+++ b/bin/sp-hook.sh
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+p="/tmp/music"
+fmt="{{xesam:trackNumber}} {{title}} <fc=sienna3>{{artist}}</fc> {{album}} <fc=grey50>{{duration(mpris:length)}}</fc>"
+
+info=$(playerctl -p spotifyd -f "$fmt" metadata)
+
+[[ -p $p ]] || mkfifo $p
+
+echo -e "$info" > "/tmp/debug"
+echo "$info" > $p