dotfiles/.scripts/get_music_info

15 lines
274 B
Plaintext
Raw Normal View History

2021-10-08 18:16:06 +02:00
#!/bin/sh
2021-10-22 14:01:55 +02:00
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