diff --git a/modules/home/wayland/apps/eww/bar/css/_sys.scss b/modules/home/wayland/apps/eww/bar/css/_sys.scss index 347139d..5df3709 100644 --- a/modules/home/wayland/apps/eww/bar/css/_sys.scss +++ b/modules/home/wayland/apps/eww/bar/css/_sys.scss @@ -30,7 +30,7 @@ .bat-accent { background-color: $base0B; } .section-sep { - @include background-active; + background-color: $base03; min-height: 2px; margin: 6pt 0 10pt; } diff --git a/modules/home/wayland/apps/eww/bar/css/_systray.scss b/modules/home/wayland/apps/eww/bar/css/_systray.scss index b3b798f..68738e0 100644 --- a/modules/home/wayland/apps/eww/bar/css/_systray.scss +++ b/modules/home/wayland/apps/eww/bar/css/_systray.scss @@ -19,7 +19,7 @@ } separator { - @include background-active; + @include background-base2; padding-top: 1px; margin: 10px 0; diff --git a/modules/home/wayland/apps/eww/bar/eww.yuck b/modules/home/wayland/apps/eww/bar/eww.yuck index f60e40c..a83e688 100644 --- a/modules/home/wayland/apps/eww/bar/eww.yuck +++ b/modules/home/wayland/apps/eww/bar/eww.yuck @@ -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") diff --git a/modules/home/wayland/apps/eww/bar/modules/clock.yuck b/modules/home/wayland/apps/eww/bar/modules/clock.yuck index c983729..3f1e17c 100644 --- a/modules/home/wayland/apps/eww/bar/modules/clock.yuck +++ b/modules/home/wayland/apps/eww/bar/modules/clock.yuck @@ -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" diff --git a/modules/home/wayland/apps/eww/bar/modules/net.yuck b/modules/home/wayland/apps/eww/bar/modules/net.yuck index d060384..89e86d6 100644 --- a/modules/home/wayland/apps/eww/bar/modules/net.yuck +++ b/modules/home/wayland/apps/eww/bar/modules/net.yuck @@ -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'}" diff --git a/modules/home/wayland/apps/eww/bar/modules/sys.yuck b/modules/home/wayland/apps/eww/bar/modules/sys.yuck index e2559b1..1fa23f9 100644 --- a/modules/home/wayland/apps/eww/bar/modules/sys.yuck +++ b/modules/home/wayland/apps/eww/bar/modules/sys.yuck @@ -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} diff --git a/modules/home/wayland/apps/eww/bar/scripts/panel-toggle b/modules/home/wayland/apps/eww/bar/scripts/panel-toggle new file mode 100755 index 0000000..0a14244 --- /dev/null +++ b/modules/home/wayland/apps/eww/bar/scripts/panel-toggle @@ -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 diff --git a/modules/home/wayland/apps/eww/bar/windows/calendar.yuck b/modules/home/wayland/apps/eww/bar/windows/calendar.yuck deleted file mode 100755 index 76db8d9..0000000 --- a/modules/home/wayland/apps/eww/bar/windows/calendar.yuck +++ /dev/null @@ -1,9 +0,0 @@ -(defwindow calendar - :monitor 0 - :geometry (geometry - :x "0%" - :y "0%" - :anchor "bottom right" - :width "0px" - :height "0px") - (window (calendar))) diff --git a/modules/home/wayland/apps/eww/bar/windows/net.yuck b/modules/home/wayland/apps/eww/bar/windows/net.yuck index 02f1fed..9ece3a0 100644 --- a/modules/home/wayland/apps/eww/bar/windows/net.yuck +++ b/modules/home/wayland/apps/eww/bar/windows/net.yuck @@ -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))) diff --git a/modules/home/wayland/apps/eww/bar/windows/popup.yuck b/modules/home/wayland/apps/eww/bar/windows/popup.yuck new file mode 100644 index 0000000..9837f73 --- /dev/null +++ b/modules/home/wayland/apps/eww/bar/windows/popup.yuck @@ -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))) diff --git a/modules/home/wayland/apps/eww/bar/windows/sys.yuck b/modules/home/wayland/apps/eww/bar/windows/sys.yuck index fc40524..39dccd6 100644 --- a/modules/home/wayland/apps/eww/bar/windows/sys.yuck +++ b/modules/home/wayland/apps/eww/bar/windows/sys.yuck @@ -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)))