diff --git a/.local/bin/acejuice-bar b/.local/bin/acejuice-bar index d341349..eaef16d 100755 --- a/.local/bin/acejuice-bar +++ b/.local/bin/acejuice-bar @@ -19,6 +19,9 @@ if [ -f "$PID_FILE" ]; then rm "$PID_FILE" fi +# Give a grace period for all processes to terminate gracefully +sleep 1 + # PID of this script printf "%s\n" "$$" >> "$PID_FILE" @@ -31,7 +34,7 @@ acejuice_monitors() { if ! mkfifo "$NPIPE_OUT" 2> /dev/null; then printf "fifo '%s' already present\n" "$NPIPE_OUT" >&2 fi - echo + if command -v xrandr > /dev/null; then __monitor_list="" OLDIFS="$IFS" @@ -48,22 +51,23 @@ acejuice_monitors() { esac done IFS="$OLDIFS" - echo "yaaa" - if [ -z "$__monitor_list" ]; then + # Remove space character prefix in the list + __monitor_list="${__monitor_list# }" + if [ -n "$__monitor_list" ]; then printf ":MON LIST %s\n" "$__monitor_list" > "$NPIPE_OUT" fi - unset __monitors_list + unset __monitor_list fi } acejuice_monitors & printf "%s\n" "$!" >> "$PID_FILE" -acejuice-pulse --socket --newline & +audio-pulse --subscribe | acejuice-pulse --socket --newline --icon ascii --icon-mute --no-value & printf "%s\n" "$!" >> "$PID_FILE" acejuice-interval --socket & printf "%s\n" "$!" >> "$PID_FILE" -acejuice | /usr/bin/lemonbar -p +acejuice | /usr/bin/lemonbar -p & printf "%s\n" "$!" >> "$PID_FILE"