diff options
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/wms | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -79,7 +79,7 @@ copy_and_notify() { } format_player_name() { - if echo "$1" | grep -Eq ^firefox\.instance.*; then + if echo "$1" | grep -Eq '^firefox\.instance.*'; then echo 'firefox' else echo "$PLAYER" @@ -88,8 +88,7 @@ format_player_name() { format_player_title() { TITLE="$(playerctl --player="$PLAYER" metadata xesam:title)" - LEN="$(echo "$TITLE" | wc -c)" - if [ "$LEN" -gt 82 ]; then + if [ "${#TITLE}" -gt 82 ]; then printf '%s...\n' "$(echo "$TITLE" | head -c 80)" else echo "$TITLE" |