17 lines
680 B
Bash
Executable File
17 lines
680 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# Toggle the shared popup window between panels (sys, net, calendar).
|
|
# Same panel clicked again → close. Different panel → close and reopen
|
|
# so the window always appears fully rendered with no transparent flash.
|
|
PANEL="$1"
|
|
CURRENT=$(eww state 2>/dev/null | grep '^active-panel:' | sed 's/^active-panel: //' | tr -d '"')
|
|
|
|
if [ "$CURRENT" = "$PANEL" ]; then
|
|
eww close popup
|
|
eww update active-panel=""
|
|
else
|
|
eww close popup 2>/dev/null
|
|
eww update active-panel="$PANEL"
|
|
SCREEN=$(hyprctl monitors -j 2>/dev/null | jq -r '.[] | select(.focused == true) | .name' | head -n1)
|
|
[ -n "$SCREEN" ] && eww open popup --screen "$SCREEN" || eww open popup
|
|
fi
|