#! /bin/bash

ISOPEN=$(eww windows | grep "*cockpit" | tr -d '*')


if [ "$ISOPEN" = "" ]; then
MONITOR=$(hyprctl monitors | grep -B 10 "focused: yes" | grep "ID" | awk -F '(' ' { print $2 } ' | tr -d 'ID ):')
  eww open cockpit_window_"$MONITOR"
else
  eww close "$ISOPEN"
fi
