From ed88184a04eaf114f0c813f4c21f62338544a442 Mon Sep 17 00:00:00 2001 From: matt1432 Date: Mon, 29 May 2023 14:26:59 -0400 Subject: [PATCH] feat: make a global eww widget closer --- eww/actions/actions.yuck | 12 +----------- eww/closer/README.md | 1 + eww/closer/closer.yuck | 9 +++++++++ eww/eww.yuck | 1 + eww/powermenu/powermenu.yuck | 10 ---------- waybar/scripts/quick-toggle.sh | 4 ++-- 6 files changed, 14 insertions(+), 23 deletions(-) create mode 100644 eww/closer/README.md create mode 100644 eww/closer/closer.yuck diff --git a/eww/actions/actions.yuck b/eww/actions/actions.yuck index 59e7ee4f..3a46add3 100644 --- a/eww/actions/actions.yuck +++ b/eww/actions/actions.yuck @@ -166,7 +166,7 @@ :space-evenly true :spacing 10 (button :class "do-logout" - :onclick "eww open powermenu && eww open powermenu-closer && eww close actions && eww close actions-closer" + :onclick "eww close closer && eww open powermenu && eww open closer" :tooltip "Logout" :halign "end" "" @@ -197,13 +197,3 @@ :anchor "top right") (actions)) - -(defwidget closer [window] - (eventbox :onclick "eww close ${window} && eww close ${window}-closer")) - -(defwindow actions-closer - :monitor 0 - :geometry (geometry :width "100%" :height "100%") - :stacking "fg" - :focusable false - (closer :window "actions")) diff --git a/eww/closer/README.md b/eww/closer/README.md new file mode 100644 index 00000000..50be92fe --- /dev/null +++ b/eww/closer/README.md @@ -0,0 +1 @@ +always open this widget last diff --git a/eww/closer/closer.yuck b/eww/closer/closer.yuck new file mode 100644 index 00000000..7b577946 --- /dev/null +++ b/eww/closer/closer.yuck @@ -0,0 +1,9 @@ +(defwidget closer [] + (eventbox :onclick "eww close-all")) + +(defwindow closer + :monitor 0 + :geometry (geometry :width "100%" :height "100%") + :stacking "fg" + :focusable false + (closer :window "")) diff --git a/eww/eww.yuck b/eww/eww.yuck index 88a0dfed..f404425c 100644 --- a/eww/eww.yuck +++ b/eww/eww.yuck @@ -3,3 +3,4 @@ (include "actions/actions.yuck") (include "powermenu/powermenu.yuck") (include "dashboard/dashboard.yuck") +(include "closer/closer.yuck") diff --git a/eww/powermenu/powermenu.yuck b/eww/powermenu/powermenu.yuck index 2abfffa6..057a50f7 100644 --- a/eww/powermenu/powermenu.yuck +++ b/eww/powermenu/powermenu.yuck @@ -44,13 +44,3 @@ :anchor "center") :wm-ignore true (powermenu)) - -(defwidget closer [window] - (eventbox :onclick "eww close ${window} && eww close ${window}-closer")) - -(defwindow powermenu-closer - :monitor 0 - :geometry (geometry :width "100%" :height "100%") - :stacking "fg" - :focusable false - (closer :window "powermenu")) diff --git a/waybar/scripts/quick-toggle.sh b/waybar/scripts/quick-toggle.sh index 7aa11cd6..84577e81 100755 --- a/waybar/scripts/quick-toggle.sh +++ b/waybar/scripts/quick-toggle.sh @@ -1,7 +1,7 @@ #!/bin/bash if [[ $(eww state | grep br_icon) ]]; then - eww close actions && eww close actions-closer + eww close actions && eww close closer else - eww open actions && eww open actions-closer + eww open actions && eww open closer fi