it scrobbles your music to rocksky
1#!/usr/bin/env bash
2
3index=0; media-control stream | \
4 while IFS= read -r line; do \
5 musicapp=$(jq -e '.payload.isMusicApp' <<< $line); \
6 if [ "$musicapp" = true ]; then \
7 title=$(jq -e '.payload.title' <<< $line); \
8 artist=$(jq -e '.payload.artist' <<< $line); \
9 if [ "$title" >/dev/null != null ]; then \
10 eval "rocksky scrobble $title $artist"; \
11 echo "rocksky scrobble $title $artist"; \
12 echo "rocksky scrobble $title $artist" >> cronlog.txt; \
13 fi \
14 fi \
15 done