From 1be65ef5c060c7fd2c135599e0f753180ae9b9f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ferit=20Yi=C4=9Fit=20BALABAN?= Date: Thu, 28 Apr 2022 02:23:28 +0300 Subject: [PATCH] Better nowplaying script in Bash --- nowplaying.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nowplaying.sh b/nowplaying.sh index 146e427..cc202a9 100755 --- a/nowplaying.sh +++ b/nowplaying.sh @@ -1,7 +1,7 @@ #!/bin/bash -status=$( playerctl status ) +s=$( playerctl -f '{{trunc(xesam:artist, 20)}} - {{trunc(xesam:title, 30)}}' metadata ) if [ $? -eq 0 ]; then - echo $( playerctl -f '{{trunc(xesam:artist, 20)}} - {{trunc(xesam:title, 30)}}' metadata ) + echo "$s" else echo "" fi