Add truncation to sb-music

This commit is contained in:
Alexis Jhon Gaspar 2023-09-22 23:43:28 +08:00
parent 92dc97db10
commit 46cf2482fe

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%")" currentSong="$(mpc current -f "%title%" | awk '{print substr($0, 1, 30) "..."}')"
fi fi
[ -z "$currentSong" ] && exit [ -z "$currentSong" ] && exit