dotfiles/.scripts/get_music_info

15 lines
274 B
Bash
Executable File

#!/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
fi