diff --git a/common/listento b/common/listento index 76e94be..0447170 100755 --- a/common/listento +++ b/common/listento @@ -1,7 +1,7 @@ #!/bin/sh # Listenbrainz + DeaDBeeF (or others) via rescrobbled if [[ $# -eq 0 ]]; then - player="deadbeef" + player="audacious" else player="$1" fi diff --git a/common/whatmusic b/common/whatmusic new file mode 100755 index 0000000..ed49a75 --- /dev/null +++ b/common/whatmusic @@ -0,0 +1,13 @@ +#!/bin/sh +api_url="https://api.listenbrainz.org/1/user/$1/playing-now" + +if [[ ! $1 ]]; then 1="siinamonster"; fi + +read artist track < <(echo $(curl -s $api_url | \ + jq -r '.payload.listens[0].track_metadata | .artist_name, .track_name')) + +if [[ "$artist" != "null" ]]; then + echo "$artist" - "$track" +else + echo "Not listening to anything right now." +fi