15 lines
274 B
Bash
Executable file
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
|