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

114 lines
2.9 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-23 13:40:45 -04:00
:onclick "$HYPR_PATH/osk-toggle.sh toggle &"
:cursor "pointer"
2023-07-23 13:40:45 -04:00
2023-07-15 00:46:04 -04:00
(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 &"}
:cursor "pointer"
2023-07-23 13:40:45 -04:00
(box :class "tablet-toggle"
:orientation "h"
(label :text " 󰦧 ")
)
)
)
(defwidget heart-toggle []
(eventbox :class {heart_icon == "󰣐" ? "toggle-on" : "toggle-off"}
:onclick "$EWW_PATH/heart.sh"
:cursor "pointer"
2023-07-23 13:40:45 -04:00
(box :class "heart-toggle"
:orientation "h"
(label :text " ${heart_icon} ")
)
)
)
(defwidget left-bar []
(box :class "transparent"
:space-evenly true
2023-07-23 13:40:45 -04:00
:spacing 12
:orientation "h"
(osk-toggle)
(tablet-toggle)
(heart-toggle)
)
)
(defwindow left-bar
:monitor 0
:stacking "overlay"
:exclusive "ignore"
2023-07-23 13:40:45 -04:00
:geometry (geometry :x "5px"
:y "10px"
:width "0px"
:height "0px"
:anchor "top left"
)
(left-bar)
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2023-07-23 13:40:45 -04:00
(defwidget quick-settings-toggle []
(eventbox :class "toggle-off"
:onclick "eww open quick-settings; eww open quick-settings-smol; eww open quick-settings-logo; eww update showqs=true"
:cursor "pointer"
2023-07-23 13:40:45 -04:00
(box :class "quick-settings-toggle"
:orientation "h"
(label :text "  ")
)
)
)
(defwindow quick-settings-toggle
:monitor 0
:stacking "overlay"
:exclusive "ignore"
:geometry (geometry :x "5px"
:y "10px"
:width "0px"
:height "0px"
:anchor "top right"
)
(quick-settings-toggle)
)
2023-07-15 00:46:04 -04:00
(defvar notif-panel-state false)
(defwidget notif-panel []
(eventbox :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"}
:cursor "pointer"
2023-07-23 13:40:45 -04:00
(box :class "notif-panel"
:orientation "h"
(label :text " ${notif_icon} ")
)
)
)
2023-07-23 13:40:45 -04:00
(defwindow notif-panel
:monitor 0
:stacking "overlay"
:exclusive "ignore"
2023-07-23 13:40:45 -04:00
:geometry (geometry :x "60px"
:y "10px"
:width "0px"
:height "0px"
:anchor "top right"
)
2023-07-23 13:40:45 -04:00
(notif-panel)
)