Single panel mode

This commit is contained in:
soraefir
2026-06-13 11:03:43 +02:00
parent da76e6c12a
commit 58af37ea8c
11 changed files with 42 additions and 35 deletions

View File

@@ -0,0 +1,16 @@
#!/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