diff options
author | EuAndreh <eu@euandre.org> | 2023-02-17 08:40:46 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2023-02-17 08:40:46 -0300 |
commit | 0d8194e1f7df8d2b5d104ba86eb8e797fd804477 (patch) | |
tree | ec451b53e61cb5adb058f0a47427687112cea283 | |
parent | bin/wms: Add "mpris" action (diff) | |
download | dotfiles-0d8194e1f7df8d2b5d104ba86eb8e797fd804477.tar.gz dotfiles-0d8194e1f7df8d2b5d104ba86eb8e797fd804477.tar.xz |
bin/wms: Fix ShellCheck offenses
-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" |