From b5539911ad4564710e1e83844532c216c1fdc59a Mon Sep 17 00:00:00 2001 From: Breizh Date: Tue, 15 Mar 2022 00:18:30 +0100 Subject: [PATCH] Meilleur suivi du temps MPD --- .i3blocks/mpd | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.i3blocks/mpd b/.i3blocks/mpd index 209be30..69da39d 100755 --- a/.i3blocks/mpd +++ b/.i3blocks/mpd @@ -32,9 +32,11 @@ human_time() { fi local minutes=$(( $seconds / 60 )) seconds=$(( $seconds % 60 )) - if [[ "$minutes" -ge 90 ]] + if [[ "$minutes" -ge 60 ]] then - printf "%5s\n" "${minutes}m" + local hours=$(( $minutes / 60 )) + minutes=$(( $minutes % 60 )) + printf "%02dh%02d\n" "$hours" "$minutes" else printf "%02d:%02d\n" "$minutes" "$seconds" fi