From c4b2e265092b335c3d02203fa7a9f9a1531916ee Mon Sep 17 00:00:00 2001 From: Wiktor Zykubek Date: Mon, 1 Jun 2020 14:04:47 +0200 Subject: [PATCH] Update mpdqueue script --- .local/bin/scripts/mpdqueue | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.local/bin/scripts/mpdqueue b/.local/bin/scripts/mpdqueue index 32e7ae2..b561f51 100755 --- a/.local/bin/scripts/mpdqueue +++ b/.local/bin/scripts/mpdqueue @@ -2,4 +2,9 @@ # Show mpd queue in notification. -notify-send -u normal "MPD queue" "$(mpc queued)" +queue="$(mpc playlist)" +items="$(echo "$queue" | wc -l)" +[ "$items" -gt 5 ] && and="and $(( "$items" - 5)) other..." + +notify-send -u normal "MPD queue" \ + "$(echo "$queue" | head -n 5)\n$and"