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

@@ -30,7 +30,7 @@
.bat-accent { background-color: $base0B; }
.section-sep {
@include background-active;
background-color: $base03;
min-height: 2px;
margin: 6pt 0 10pt;
}

View File

@@ -19,7 +19,7 @@
}
separator {
@include background-active;
@include background-base2;
padding-top: 1px;
margin: 10px 0;

View File

@@ -5,9 +5,11 @@
(include "modules/systray.yuck")
(include "modules/clock.yuck")
(include "windows/calendar.yuck")
(defvar active-panel "")
(include "windows/sys.yuck")
(include "windows/net.yuck")
(include "windows/popup.yuck")
(include "windows/radio.yuck")
(include "windows/powermenu.yuck")

View File

@@ -5,7 +5,7 @@
(eventbox
:onhover "${EWW_CMD} update date_rev=true"
:onhoverlost "${EWW_CMD} update date_rev=false"
:onclick "(sleep 0.1 && eww-open-on-current-screen calendar --toggle)"
:onclick "(sleep 0.1 && scripts/panel-toggle calendar)"
:onrightclick "(sleep 0.1 && eww-open-on-current-screen powermenu --toggle)"
(box
:class "datetime"

View File

@@ -9,7 +9,7 @@
(defwidget net-mod []
(module
(eventbox
:onclick "(sleep 0.1 && eww-open-on-current-screen net --toggle)"
:onclick "(sleep 0.1 && scripts/panel-toggle net)"
(box :orientation "v"
(label
:class "net-icon ${net.ethernet.connected ? 'net-active' : 'net-dim'}"

View File

@@ -6,7 +6,7 @@
(defwidget sys-mod []
(module
(eventbox
:onclick "(sleep 0.1 && eww-open-on-current-screen sys --toggle)"
:onclick "(sleep 0.1 && scripts/panel-toggle sys)"
(box :orientation "v"
(circular-progress
:value {EWW_CPU.avg}

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

View File

@@ -1,9 +0,0 @@
(defwindow calendar
:monitor 0
:geometry (geometry
:x "0%"
:y "0%"
:anchor "bottom right"
:width "0px"
:height "0px")
(window (calendar)))

View File

@@ -103,12 +103,3 @@
(wifi-net-section)
(box :class "section-sep")
(bluetooth-net-section)))
(defwindow net
:monitor 0
:stacking "overlay"
:geometry (geometry
:x "0%" :y "0%"
:anchor "bottom right"
:width "300px" :height "0px")
(window (net-win)))

View File

@@ -0,0 +1,18 @@
(defwidget popup-win []
(box :space-evenly false :orientation "v"
(box :visible {active-panel == "sys"}
(sys-win))
(box :visible {active-panel == "net"}
(net-win))
(box :visible {active-panel == "calendar"} :class "sys-win"
(calendar))))
(defwindow popup
:monitor 0
:stacking "overlay"
:geometry (geometry
:x "0%" :y "0%"
:anchor "bottom right"
:width "320px" :height "0px")
(window (popup-win)))

View File

@@ -209,14 +209,3 @@
(bat-sys-win)
)
)
(defwindow sys
:monitor 0
:stacking "overlay"
:geometry (geometry
:x "0%"
:y "0%"
:anchor "bottom right"
:width "320px"
:height "0px")
(window (sys-win)))