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

94 lines
2.3 KiB
Text
Raw Normal View History

(defvar osk-ts false)
2023-07-15 00:46:04 -04:00
(defwidget osk-toggle []
(eventbox :class {osk-ts ? "toggle-on" : "toggle-off"}
2023-07-15 00:46:04 -04:00
:onclick "$HYPR_PATH/osk-toggle.sh toggle &"
(box :class "osk-toggle"
:orientation "h"
(label :text " 󰌌 ")
)
)
)
(defvar tablet-ts false)
(defwidget tablet-toggle []
(eventbox :class {tablet-ts ? "toggle-on" : "toggle-off"}
:onclick {tablet-ts ? "$HYPR_PATH/laptop-mode.sh &" :
"$HYPR_PATH/tablet-mode.sh &"}
(box :class "tablet-toggle"
:orientation "h"
(label :text " 󰦧 ")
)
)
)
(defvar heart-ts true)
(defvar heart-icon "󰣐")
(defwidget heart-toggle []
(eventbox :class {heart-ts ? "toggle-on" : "toggle-off"}
:onclick {heart-ts ? "eww update heart-icon= ; eww update heart-ts=false" :
"eww update heart-icon=󰣐 ; eww update heart-ts=true"}
(box :class "heart-toggle"
:orientation "h"
(label :text " ${heart-icon} ")
)
)
)
(defwidget left-bar []
(box :class "transparent"
:space-evenly true
:spacing 14
:orientation "h"
(osk-toggle)
(tablet-toggle)
(heart-toggle)
)
)
(defwindow left-bar
:monitor 0
:stacking "overlay"
:exclusive "ignore"
:geometry (geometry :x "10px"
:y "11px"
:width "0px"
:height "0px"
:anchor "top left"
)
(left-bar)
)
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"
:orientation "h"
(label :text " ${notif_icon} ")
)
)
)
(defwidget right-bar []
(box :class "transparent"
:space-evenly true
:spacing 14
:orientation "h"
(notif-panel)
)
)
(defwindow right-bar
: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"
)
(right-bar)
)