From 0d8194e1f7df8d2b5d104ba86eb8e797fd804477 Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Fri, 17 Feb 2023 08:40:46 -0300 Subject: bin/wms: Fix ShellCheck offenses --- bin/wms | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'bin/wms') diff --git a/bin/wms b/bin/wms index d541438..03b5b05 100755 --- a/bin/wms +++ b/bin/wms @@ -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" -- cgit v1.2.3