From 18113aad1a0f50f8596486f64332eed859a79813 Mon Sep 17 00:00:00 2001 From: Charlie39 Date: Thu, 23 Apr 2020 01:45:53 +0530 Subject: [PATCH] Replaced pgrep with pidof (#592) * dwm compliant revised PR * replaced pgrep with pidof because it is faster! * Update music --- .local/bin/statusbar/music | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.local/bin/statusbar/music b/.local/bin/statusbar/music index 1412ae3..1b18776 100755 --- a/.local/bin/statusbar/music +++ b/.local/bin/statusbar/music @@ -1,7 +1,8 @@ #!/bin/sh filter() { - sed "/^volume:/d" | tac | sed -e "s/\\&/&/g;s/\\[paused\\].*//g;s/\\[playing\\].*//g" | tr -d '\n' | sed -e "s/$/<\\/span>\n/g" + [ "$(pidof dwmblocks)" ] && sed "/^volume:/d" | tac | sed -e "s/\\&/&/g;s/\\[paused\\].*/\\[paused\\] /g;s/\\[playing\\].*//" | tr -d '\n' | sed -e "s/\..*$//g" \ + || sed "/^volume:/d" | tac | sed -e "s/\\&/&/g;s/\\[paused\\].*//g;s/\\[playing\\].*//g" | tr -d '\n' | sed -e "s/$/<\\/span>\n/g" } case $BLOCK_BUTTON in