32 lines
769 B
Plaintext
32 lines
769 B
Plaintext
|
#!/bin/sh
|
||
|
|
||
|
[ -z "$MPANEL_FONT" ] && MPANEL_FONT="JetBrainsMono Nerd Font Mono"
|
||
|
[ -z "$MPANEL_MAX_LINKS" ] && MPANEL_MAX_LINKS="25"
|
||
|
|
||
|
PIPE="$XDG_RUNTIME_DIR/mpanel.fifo"
|
||
|
|
||
|
if [ -p "$PIPE" ] || [ -f "$PIPE" ]; then
|
||
|
rm -f "$PIPE"
|
||
|
[ -p "$PIPE" ] && exit 1
|
||
|
[ -f "$PIPE" ] && exit 1
|
||
|
fi
|
||
|
mkfifo -m 0660 "$PIPE" || exit 1
|
||
|
|
||
|
cd "$(dirname "$0")" || exit 1
|
||
|
|
||
|
./parser < "$PIPE" | lemonbar \
|
||
|
-f "$MPANEL_FONT" \
|
||
|
-B "$(sed '1!d' ./colors)" \
|
||
|
-F "$(sed '2!d' ./colors)" \
|
||
|
-a "$MPANEL_MAX_LINKS" | sh &
|
||
|
|
||
|
trap "trap - TERM && kill -- -$$" INT TERM EXIT
|
||
|
|
||
|
cd "modules" || exit 1
|
||
|
|
||
|
for module in $(ls); do
|
||
|
"./$module" > "$PIPE" &
|
||
|
done
|
||
|
|
||
|
wait
|