Single panel mode
This commit is contained in:
@@ -30,7 +30,7 @@
|
||||
.bat-accent { background-color: $base0B; }
|
||||
|
||||
.section-sep {
|
||||
@include background-active;
|
||||
background-color: $base03;
|
||||
min-height: 2px;
|
||||
margin: 6pt 0 10pt;
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
}
|
||||
|
||||
separator {
|
||||
@include background-active;
|
||||
@include background-base2;
|
||||
padding-top: 1px;
|
||||
margin: 10px 0;
|
||||
|
||||
|
||||
@@ -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")
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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'}"
|
||||
|
||||
@@ -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}
|
||||
|
||||
16
modules/home/wayland/apps/eww/bar/scripts/panel-toggle
Executable file
16
modules/home/wayland/apps/eww/bar/scripts/panel-toggle
Executable 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
|
||||
@@ -1,9 +0,0 @@
|
||||
(defwindow calendar
|
||||
:monitor 0
|
||||
:geometry (geometry
|
||||
:x "0%"
|
||||
:y "0%"
|
||||
:anchor "bottom right"
|
||||
:width "0px"
|
||||
:height "0px")
|
||||
(window (calendar)))
|
||||
@@ -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)))
|
||||
|
||||
18
modules/home/wayland/apps/eww/bar/windows/popup.yuck
Normal file
18
modules/home/wayland/apps/eww/bar/windows/popup.yuck
Normal 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)))
|
||||
@@ -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)))
|
||||
|
||||
Reference in New Issue
Block a user