Fix truncation on sb-music

This commit is contained in:
Alexis Jhon Gaspar 2023-09-22 23:48:22 +08:00
parent 46cf2482fe
commit f33ee985e0

View file

@ -18,7 +18,7 @@ if status="$(playerctl "$@" status 2>&1)" && [ "$status" != "Stopped" ]; then
currentSong="$(playerctl "$@" metadata --format "{{title}} - {{artist}}")" currentSong="$(playerctl "$@" metadata --format "{{title}} - {{artist}}")"
else else
[ "$(mpc status "%state%")" = "paused" ] && icon="$pausedIcon" [ "$(mpc status "%state%")" = "paused" ] && icon="$pausedIcon"
currentSong="$(mpc current -f "%title%" | awk '{print substr($0, 1, 30) "..."}')" currentSong="$(mpc current -f "%title%" | sed 's/\(.\{30\}\).*/\1.../')"
fi fi
[ -z "$currentSong" ] && exit [ -z "$currentSong" ] && exit