blob: 0f27d9f2c59aad9d7674bb918d9c058e30e0a050 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
(defwidget bar []
(centerbox :orientation "v"
(workspaces)
"test"
(battery)))
(defwidget workspace-btn [n ?icon]
(button :onclick "hyprctl dispatch 'workspace ${n}'"
:halign "baseline"
:hexpand true
"${icon ?: n}"))
(defwidget workspaces []
(box :class "workspaces"
:orientation "v"
:space-evenly true
:valign "start"
:halign "center"
(workspace-btn :n 1 :icon "")
(workspace-btn :n 2 :icon "")
(workspace-btn :n 3 :icon "")
(workspace-btn :n 4 :icon "")
(workspace-btn :n 5 :icon "")
(workspace-btn :n 6 :icon "")
(workspace-btn :n 7 :icon "")
(workspace-btn :n 8 :icon "")
(workspace-btn :n 9 :icon "")))
(defwidget battery []
(metric :label ""
:value {EWW_BATTERY}
:onchange ""))
(defwidget metric [label value onchange]
(box :orientation "v"
:class "metric"
:space-evenly false
(box :class "label" label)
(scale :min 0
:max 101
:active {onchange != ""}
:value value
:onchange onchange)))
(defwindow bar
:monitor 0
:geometry (geometry :width "1.25%"
:height "98%"
:anchor "right center")
:stacking "fg"
:windowtype "dock"
:exclusive true
(bar))
|