From c153ac7fb427cf517db6d5e5bff0857ee894d407 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Tue, 26 May 2020 07:22:06 -0400 Subject: [PATCH] mpd-module-update now mpdup it is autostarted by the music module if not already running --- .local/bin/{mpd-module-update => statusbar/mpdup} | 2 +- .local/bin/statusbar/music | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) rename .local/bin/{mpd-module-update => statusbar/mpdup} (70%) diff --git a/.local/bin/mpd-module-update b/.local/bin/statusbar/mpdup similarity index 70% rename from .local/bin/mpd-module-update rename to .local/bin/statusbar/mpdup index ced910f..af81a7d 100755 --- a/.local/bin/mpd-module-update +++ b/.local/bin/statusbar/mpdup @@ -4,5 +4,5 @@ # music player's status. mpd must be running on X's start for this to work. while : ; do - mpc idle >/dev/null && pkill -RTMIN+11 "${STATUSBAR:-dwmblocks}" || break + mpc idle >/dev/null && kill -45 "$(pidof "${STATUSBAR:-dwmblocks}")" || break done diff --git a/.local/bin/statusbar/music b/.local/bin/statusbar/music index 8c60919..54eced5 100755 --- a/.local/bin/statusbar/music +++ b/.local/bin/statusbar/music @@ -2,6 +2,8 @@ filter() { mpc | sed "/^volume:/d;s/\\&/&/g;s/\\[paused\\].*/⏸/g;/\\[playing\\].*/d" | paste -sd ' ';} +pidof -x mpdup >/dev/null 2>&1 || mpdup & + case $BLOCK_BUTTON in 1) mpc status | filter ; setsid "$TERMINAL" -e ncmpcpp & ;; # right click, pause/unpause 2) mpc toggle | filter ;; # right click, pause/unpause