57 lines
1.4 KiB
Text
57 lines
1.4 KiB
Text
|
(defwidget powermenu []
|
||
|
(box :class "powermenu"
|
||
|
:orientation "h"
|
||
|
:space-evenly true
|
||
|
:spacing 20
|
||
|
(button :class "shutdown"
|
||
|
:onclick "systemctl poweroff"
|
||
|
(label :text "襤" :class "content")
|
||
|
)
|
||
|
(button :class "reboot"
|
||
|
:onclick "systemctl reboot"
|
||
|
(label :text "勒" :class "content")
|
||
|
)
|
||
|
(button :class "logout"
|
||
|
:onclick "swaymsg exit"
|
||
|
(label :text "" :class "content")
|
||
|
)
|
||
|
)
|
||
|
)
|
||
|
|
||
|
(defwidget powermenu-clickhandler []
|
||
|
(button :class "powermenu-clickhandler"
|
||
|
:onclick "eww -c ~/.config/eww close powermenu powermenu-clickhandler"
|
||
|
""
|
||
|
)
|
||
|
)
|
||
|
|
||
|
(defwindow powermenu-clickhandler
|
||
|
:monitor 0
|
||
|
:geometry (geometry :x "0px"
|
||
|
:y "0px"
|
||
|
:width "100%"
|
||
|
:height "100%"
|
||
|
:anchor "center")
|
||
|
:wm-ignore true
|
||
|
(powermenu-clickhandler))
|
||
|
|
||
|
(defwindow powermenu
|
||
|
:monitor 0
|
||
|
:geometry (geometry :x "0px"
|
||
|
:y "0px"
|
||
|
:width "500px"
|
||
|
:height "150px"
|
||
|
: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"))
|