#!/usr/bin/env bash

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

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

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

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


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

