From 06f12333659af8c23fce8f9383084c2c16b8d8b6 Mon Sep 17 00:00:00 2001 From: InigoGutierrez Date: Sun, 30 Dec 2018 23:07:23 +0100 Subject: i3music.sh now shows only filename when title doesn't exist. --- i3blocks/i3music.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'i3blocks') diff --git a/i3blocks/i3music.sh b/i3blocks/i3music.sh index 4811e08..24deb3f 100755 --- a/i3blocks/i3music.sh +++ b/i3blocks/i3music.sh @@ -12,7 +12,7 @@ stat="$(cmus-remote -Q | grep "status " | awk '{print $2}')" artist="$(cmus-remote -Q | grep "tag artist " | cut -d' ' -f3-)" title="$(cmus-remote -Q | grep "tag title " | cut -d' ' -f3-)" [ -z "$artist" ] && artist="(unknown)" -[ -z "$title" ] && title="$(cmus-remote -Q | grep "file " | cut -d'/' -f5-)" +[ -z "$title" ] && title="[$(basename "$(cmus-remote -Q | grep "file " | cut -d'/' -f5-)")]" if [ "$stat" = "playing" ]; then echo "$symbol $artist ─ $title" elif [ "$stat" = "paused" ]; then -- cgit v1.2.1