feat: make a global eww widget closer

This commit is contained in:
matt1432 2023-05-29 14:26:59 -04:00
parent 7fbfdb1802
commit ed88184a04
6 changed files with 14 additions and 23 deletions

View file

@ -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"))

1
eww/closer/README.md Normal file
View file

@ -0,0 +1 @@
always open this widget last

9
eww/closer/closer.yuck Normal file
View file

@ -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 ""))

View file

@ -3,3 +3,4 @@
(include "actions/actions.yuck")
(include "powermenu/powermenu.yuck")
(include "dashboard/dashboard.yuck")
(include "closer/closer.yuck")

View file

@ -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"))

View file

@ -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