From e0eaf5e4b93c87fd435edb5148a1234e89c09ed1 Mon Sep 17 00:00:00 2001 From: David JULIEN Date: Tue, 2 Mar 2021 20:28:37 +0100 Subject: [PATCH] feat: simplify player exit on music stop (no notification) doesn't call statusbar update --- .local/bin/player | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.local/bin/player b/.local/bin/player index ab51a43..443c0da 100755 --- a/.local/bin/player +++ b/.local/bin/player @@ -12,11 +12,12 @@ MPC_FORMAT="Artist: %artist% \nTitle: %title% \nAlbum: %album%" out="$(mpc --format "$MPC_FORMAT" $1 | head -n-1)" +kill -39 $(pidof dwmblocks) if [ -z "$out" ]; then - out="No music" + exit else - path="$(mpc --format %file% | head -n1 | awk -F '/' '{ printf "music/%s/%s/cover.png\n", $1,$2 }')" + path="$(mpc --format %file% | head -n1 | awk -F '/' '{ printf "music/%s/%s/cover.jpg\n", $1,$2 }')" + echo $path + dunstify -r 10010 -u "normal" -i "$HOME/$path" "MPD" "$out" fi -dunstify -r 10010 -u "normal" -i "$HOME/$path" "MPD" "$out" -kill -39 $(pidof dwmblocks)