blob: e599a529e031ffd84d9a9be8dcbc3caa16bac588 (
plain) (
blame)
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
|
(defvar battery_rev false)
(defvar brightness_rev false)
(defvar emails_rev false)
(defvar keymap_rev false)
(defvar user_rev false)
(defvar volume_rev false)
(defvar wireless_rev false)
;; Listeners
(deflisten active-workspace
`stdbuf -oL scripts/active-workspace-listener`)
(deflisten workspace-list :initial '[[1]]'
`stdbuf -oL scripts/workspace-list-listener`)
(deflisten datetime
`stdbuf -oL scripts/datetime-listener`)
(deflisten brightness
`stdbuf -oL scripts/backlight-listener`)
(deflisten volume :initial '{"icon":"","percentage":""}'
`stdbuf -oL scripts/volume-listener`)
(deflisten keymap
`stdbuf -oL scripts/keymap-listener`)
(deflisten emails :initial '{"icon":"","text":""}'
`stdbuf -oL scripts/email-listener`)
;; Pollers
(defpoll user :interval "69h"
`whoami | sed 's/.*/\\u&/'`)
(defpoll battery :initial '{"icon":"","percentage":""}' :interval "1s"
`scripts/battery`)
(defpoll wireless :interval "1s"
`scripts/wireless`)
;; Windows
(defwindow bar-1
:monitor 0
:stacking "fg"
:exclusive true
:geometry (geometry :width "100%" :height "40px" :anchor "top center")
(bar :monitor 0))
(defwindow bar-2
:monitor 1
:stacking "fg"
:exclusive true
:geometry (geometry :width "100%" :height "40px" :anchor "top center")
(bar :monitor 1))
;; Widgets
(defwidget bar [monitor]
(centerbox
(start :monitor monitor)
(middle)
(end)))
(defwidget start [monitor]
(workspaces :monitor monitor))
(defwidget middle []
(clock))
(defwidget end []
(box :halign "end"
:class "end"
:space-evenly false
(emails)
(keymap)
(wireless)
(brightness)
(volume)
(battery)
(user)))
(defwidget workspaces [monitor]
(box :class "workspaces"
:space-evenly false
(for id in {workspace-list[monitor]}
(button :class {active-workspace[monitor] == id ? "active" : ""}
:onclick `hyprctl dispatch workspace ${id}`
id))))
(defwidget clock []
datetime)
(defwidget wireless []
(eventbox
:onhover "eww update wireless_rev=true"
:onhoverlost "eww update wireless_rev=false"
(box :vexpand false
:hexpand false
:space-evenly false
:width 30
(label :text "")
(revealer :transition "slideright"
:reveal wireless_rev
:duration "350ms"
(label :text wireless)))))
(defwidget keymap []
(eventbox
:onhover "eww update keymap_rev=true"
:onhoverlost "eww update keymap_rev=false"
(box :vexpand false
:hexpand false
:space-evenly false
:width 30
(label :text "")
(revealer :transition "slideright"
:reveal keymap_rev
:duration "350ms"
(label :text keymap)))))
(defwidget brightness []
(eventbox
:onhover "eww update brightness_rev=true"
:onhoverlost "eww update brightness_rev=false"
(box :vexpand false
:hexpand false
:space-evenly false
:width 30
(label :text "")
(revealer :transition "slideright"
:reveal brightness_rev
:duration "350ms"
(label :text brightness)))))
(defwidget volume []
(eventbox
:onhover "eww update volume_rev=true"
:onhoverlost "eww update volume_rev=false"
(box :vexpand false
:hexpand false
:space-evenly false
:width 30
(label :text {volume.icon})
(revealer :transition "slideright"
:reveal volume_rev
:duration "350ms"
(label :text {volume.percentage})))))
(defwidget battery []
(eventbox
:onhover "eww update battery_rev=true"
:onhoverlost "eww update battery_rev=false"
(box :vexpand false
:hexpand false
:space-evenly false
:width 30
(label :text {battery.icon})
(revealer :transition "slideright"
:reveal battery_rev
:duration "350ms"
(label :text {battery.percentage})))))
(defwidget emails []
(eventbox
:onhover "eww update emails_rev=true"
:onhoverlost "eww update emails_rev=false"
(box :vexpand false
:hexpand false
:space-evenly false
:width 30
(label :text {emails.icon})
(revealer :transition "slideright"
:reveal emails_rev
:duration "350ms"
(label :text {emails.text})))))
(defwidget user []
(eventbox
:onhover "eww update user_rev=true"
:onhoverlost "eww update user_rev=false"
(box :vexpand false
:hexpand false
:space-evenly false
:width 30
(label :text "")
(revealer :transition "slideright"
:reveal user_rev
:duration "350ms"
(label :text user)))))
(defwidget pair [icon text]
(box :width 70
:space-evenly false
(label :text icon)
(label :text text)))
|