change music info source

This commit is contained in:
qvalentin 2021-10-22 14:01:55 +02:00
parent 826468d54d
commit d33b9b4670
5 changed files with 16 additions and 4 deletions

View file

@ -1,2 +1,14 @@
#!/bin/sh
head ~/.wnpClient/wnpClient.txt -n 2 | sed ':a;N;$!ba;s/\n/ by /g'
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