From 9e79da4fadd18028ca1111f8b8836efbdbdbca03 Mon Sep 17 00:00:00 2001 From: Breizh Date: Sat, 13 Aug 2022 02:28:54 +0200 Subject: [PATCH] Meilleure gestion des webradios --- .i3blocks/mpd | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.i3blocks/mpd b/.i3blocks/mpd index 1d915d6..00a796e 100755 --- a/.i3blocks/mpd +++ b/.i3blocks/mpd @@ -18,7 +18,8 @@ sed '/^OK/q' <&"$OUT" &>/dev/null # Initialisation des valeurs par défaut et des fonctions declare -i SCROLL=50 I=0 -declare -- artist song oldfile +declare -- artist song +declare -A old human_time() { local seconds="${1}" @@ -107,7 +108,7 @@ do # En cas de changement de morceau, # on réinitialise l’affichage défilant - if [[ "${o["file"]}" != "$oldfile" ]] + if [[ "${o["file"]}" != "${old["file"]}" || "${o["Title"]}" != "${old["Title"]}" || "${o["Name"]}" != "${old["Name"]}" ]] then unset bloc1 bloc2 bloc3 bloc4 artist="${o["Artist"]:-${o["Name"]}}" @@ -126,7 +127,9 @@ do bloc1="$artist" bloc2="$song" - oldfile="${o["file"]}" + old["file"]="${o["file"]}" + old["Title"]="${o["Title"]}" + old["Name"]="${o["Name"]}" I=0 fi