#!/bin/sh
status=$(playerctl status -a)
title=$(playerctl metadata title)
artist=$(playerctl metadata artist)
if [[ $status =~ Playing ]]; then
length=${#title}
if [ $length -gt 35 ]; then
echo "$title"
else
echo "$title by $artist"
fi