helm/os/arch/.config/panel/panel.sh

53 lines
996 B
Bash
Raw Normal View History

2016-10-19 07:56:37 -07:00
#!/usr/bin/env dash
2016-10-31 19:07:23 -07:00
# trap "trap - TERM; kill 0" INT TERM QUIT EXIT
2016-10-19 07:56:37 -07:00
2016-10-31 19:07:23 -07:00
#
PANEL_FIFO=/tmp/panel-fifo
2016-10-19 07:56:37 -07:00
PWD=$(dirname $0)
2016-10-31 19:07:23 -07:00
THEME="hax"
LEMONBAR="$(pgrep -cx lemonbar)"
. $PWD/themes/$THEME.sh
if [ "$#" -eq 0 ]; then
[ -e "$PANEL_FIFO" ] && rm "$PANEL_FIFO"
mkfifo "$PANEL_FIFO"
if [ "$LEMONBAR" -gt 0 ]
then
echo "Lemonbar already running"
exit
fi
# Load all lemons (components)
for comp in $PWD/lemons/*.sh
do
echo "INIT: $(basename $comp)"
. "$comp" > "$PANEL_FIFO" &
done
#
# Bootstrap panel(s)
#
$PWD/panel_parse.sh $THEME < "$PANEL_FIFO" | \
lemonbar \
-a 32 \
-g x$PANEL_HEIGHT \
-f "$PANEL_FONT" \
-f "$ICON_FONT" \
-F "$COLOR_DEFAULT_FG" \
-B "$COLOR_DEFAULT_BG" \
| sh &
wait
elif [ -e "$PANEL_FIFO" ] && [ "$LEMONBAR" -gt 0 ]
then
if [ -f "$PWD/lemons/$1.sh" ]
then
. "$PWD/lemons/$1.sh" > "$PANEL_FIFO" &
fi
fi
2016-10-19 07:56:37 -07:00