Adjust trunctation charlimit

This commit is contained in:
Alexis Jhon Gaspar 2023-09-23 21:15:43 +08:00
parent bb34217d59
commit c8f59969c9

View file

@ -15,10 +15,10 @@ icon=""
pausedIcon=""
if status="$(playerctl "$@" status 2>&1)" && [ "$status" != "Stopped" ]; then
[ "$status" = "Paused" ] && icon="$pausedIcon"
currentSong="$(playerctl "$@" metadata --format "{{title}}" | sed 's/\(.\{22\}\).*/\1.../')"
currentSong="$(playerctl "$@" metadata --format "{{title}}" | sed 's/\(.\{30\}\).*/\1.../')"
else
[ "$(mpc status "%state%")" = "paused" ] && icon="$pausedIcon"
currentSong="$(mpc current -f "%title%" | sed 's/\(.\{22\}\).*/\1.../')"
currentSong="$(mpc current -f "%title%" | sed 's/\(.\{30\}\).*/\1.../')"
fi
[ -z "$currentSong" ] && exit