nixos-configs/configs/eww/traybuttons/traybuttons.yuck

87 lines
2 KiB
Text
Raw Normal View History

2023-07-15 00:46:04 -04:00
(defvar osk-toggle-state false)
(defwidget osk-toggle []
(eventbox :class {osk-toggle-state ? "toggle-on" : "toggle-off"}
:onclick "$HYPR_PATH/osk-toggle.sh toggle &"
(box :class "osk-toggle"
:space-evenly true
:spacing 6
:orientation "h"
(label :text " 󰌌 ")
)
)
)
(defwindow osk-toggle
:monitor 0
:stacking "overlay"
:exclusive "ignore"
:geometry (geometry :x "10px"
:y "9px"
:width "0px"
:height "0px"
:anchor "top left"
)
(osk-toggle)
)
(defvar toggle-state false)
(defwidget tablet-toggle []
(eventbox :class {toggle-state ? "toggle-on" : "toggle-off"}
:onclick {toggle-state ? "$HYPR_PATH/laptop-mode.sh &" :
"$HYPR_PATH/tablet-mode.sh &"}
(box :class "tablet-toggle"
:space-evenly true
:spacing 6
:orientation "h"
(label :text " 󰦧 ")
)
)
)
(defwindow tablet-toggle
:monitor 0
:stacking "overlay"
:exclusive "ignore"
2023-07-15 00:46:04 -04:00
:geometry (geometry :x "72px"
:y "9px"
:width "0px"
:height "0px"
:anchor "top left"
)
(tablet-toggle)
)
2023-07-15 00:46:04 -04:00
(defvar notif-panel-state false)
(defwidget notif-panel []
(button :class {notif-panel-state ? "toggle-on" : "toggle-off"}
:onclick {notif-panel-state ? "swaync-client -cp; eww update notif-panel-state=false" :
"swaync-client -op; eww update notif-panel-state=true"}
(box :class "notif-panel"
:space-evenly true
:spacing 6
:orientation "h"
(label :text " ${notif_icon} ")
)
)
)
(defwindow notif-panel
:monitor 0
:stacking "overlay"
:exclusive "ignore"
:geometry (geometry :x "50px"
2023-07-15 00:46:04 -04:00
:y "11px"
:width "0px"
:height "0px"
:anchor "top right"
)
(notif-panel)
)