treewide: preliminary Wayland!
This commit is contained in:
parent
67798937bb
commit
2602b8bc1c
11 changed files with 197 additions and 11 deletions
67
res/eww-wayland/eww.yuck
Normal file
67
res/eww-wayland/eww.yuck
Normal file
|
|
@ -0,0 +1,67 @@
|
|||
(defwindow mainbar :monitor 0
|
||||
:geometry (geometry :x "0%"
|
||||
:y "0%"
|
||||
:width "100%"
|
||||
:height "30px"
|
||||
:anchor "top center")
|
||||
:stacking "fg"
|
||||
:exclusive false
|
||||
:focusable false
|
||||
(bar))
|
||||
|
||||
(defvar time-extended false) ; for :run-while property of below variable
|
||||
; when this turns true, the polling starts and
|
||||
; var gets updated with given interval
|
||||
|
||||
(defpoll ptime :interval "1s"
|
||||
:run-while !time-extended
|
||||
`date +%H:%M`)
|
||||
(defpoll petimea :interval "1s"
|
||||
:run-while time-extended
|
||||
`date "+%A, %d %B %Y "`)
|
||||
(defpoll petimeb :interval "1s"
|
||||
:run-while time-extended
|
||||
`date "+:%S"`)
|
||||
|
||||
(deflisten ltitle "./scripts/title.sh")
|
||||
(deflisten lworkspaces :initial "[]" "./scripts/workspaces.sh")
|
||||
(deflisten lcurrent_workspace :initial "1" "./scripts/active-workspace.sh")
|
||||
|
||||
(defwidget bar []
|
||||
(eventbox :onscroll "./scripts/scroll.sh {}"
|
||||
(centerbox :orientation "h"
|
||||
:class "bar"
|
||||
(workspaces)
|
||||
(title)
|
||||
(time))))
|
||||
|
||||
(defwidget workspaces []
|
||||
(box :class "widget workspaces"
|
||||
:halign "start"
|
||||
:valign "center"
|
||||
:vexpand true
|
||||
:hexpand true
|
||||
(for workspace in lworkspaces
|
||||
(eventbox :cursor "hand"
|
||||
(button :class "${workspace.id == lcurrent_workspace ? "focused" : (workspace.windows > 0 ? "occupied" : "empty")}"
|
||||
:onclick "hyprctl dispatch workspace ${workspace.id}"
|
||||
"${workspace.id == lcurrent_workspace ? "" : (workspace.windows > 0 ? "" : "")}")))))
|
||||
|
||||
(defwidget title []
|
||||
(literal :content ltitle))
|
||||
|
||||
(defwidget time_extension [text]
|
||||
(label :text text
|
||||
:class "extension"))
|
||||
|
||||
(defwidget time []
|
||||
(button :onclick `eww update time-extended=${time-extended ? "false" : "true"}`
|
||||
(box :orientation "horizontal"
|
||||
:space-evenly false
|
||||
:halign "end"
|
||||
:class "widget time"
|
||||
(time_extension :text {time-extended ? petimea : ""})
|
||||
(label :text ptime
|
||||
:class "base")
|
||||
(time_extension :text {time-extended ? petimeb : ""}))))
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue