#!/usr/bin/env bash

#By: S4NKALP https://github.com/S4NKALP 

FILE="$HOME/.cache/eww.panel"
ewwcfg="$HOME/.config/bspwm/widgets/info-panel"
EWW=`which eww`

if [[ ! `pidof eww` ]]; then
	${EWW} -c $HOME/.config/bspwm/widgets/info-panel daemon &
	sleep 1
fi

launch_eww() {
	${EWW} --config "$ewwcfg" open info-panel
}


## Launch or close widgets accordingly
if [[ ! -f "$FILE" ]]; then
	touch "$FILE"
	launch_eww
else
	${EWW} --config "$ewwcfg" close info-panel
	rm "$FILE"
fi

