-
Notifications
You must be signed in to change notification settings - Fork 0
/
eww.yuck
387 lines (354 loc) · 8.95 KB
/
eww.yuck
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
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
; (defvar hyprkool "/home/issac/0Git/hyprkool/target/debug/hyprkool")
(defvar hyprkool "hyprkool")
; - [[FEATURE] Can't format command strings · Issue #998 · elkowar/eww · GitHub](https://github.com/elkowar/eww/issues/998)
(deflisten workspace-windows :initial "[]" "hyprkool info -m active-workspace-windows -s 64 -t Papirus")
(deflisten active-window :initial "{}" "hyprkool info -m active-window -s 64 -t Papirus")
(deflisten activities :initial "[]" "hyprkool info -m activities")
(deflisten workspaces :initial "{}" "hyprkool info -m workspaces")
(deflisten all-workspaces :initial "{}" "hyprkool info -m all-workspaces")
(deflisten submap :initial "{\"submap\": \"\"}" "hyprkool info -m submap")
(deflisten brightness :initial "{}" "./scripts/brightness.sh")
(defpoll volume :initial "{\"level\": 0, \"muted\": true}" :interval "5s" "./scripts/volume.sh")
(defpoll mic :initial "{\"level\": 0, \"muted\": true}" :interval "5s" "./scripts/mic.sh")
(defpoll network :initial "{\"enabled\": false}" :interval "30s" "./scripts/network.sh")
(defpoll power :initial "{\"profile\": \"donno\"}" :interval "60s" "./scripts/power.sh")
(defpoll time :initial "" :interval "60s" "date '+%H:%M'")
(defpoll date :initial "" :interval "60s" "date '+%a %d/%m/%Y'")
(defwindow top-bar
:stacking "fg"
:namespace "eww"
:monitor 0
:geometry (geometry
:y 2
:width "100%"
:height "36px"
:anchor "top left"
)
(centerbox
(box
:halign "start"
:style "
margin-left: 5px;
"
:space-evenly false
:spacing 5
(Launcher)
(Activities)
; (Workspaces)
(AllWorkspaces)
(Submap)
)
(box
:halign "center"
:space-evenly false
(WorkspaceWindows :icon-size 36)
)
(box
:halign "end"
:style "
margin-right: 5px;
"
:space-evenly false
:spacing 5
(systray
:class "tray"
:spacing 5
)
(Stats)
)
)
)
(defwindow cal
:stacking "fg"
:namespace "eww"
:monitor 0
:geometry (geometry
:y 0
:x 10
:width "0%"
:height "0%"
:anchor "top right"
)
(Cal)
)
(defwidget WorkspaceWindows [icon-size]
(box :space-evenly false :orientation "horizontal" :halign "center"
(label :visible false :text "${active-window}") ; without this, it does not update in the style for some reason
(for window in workspace-windows
(box
:style "
background-color: #24273a;
border: 3px solid ${window.title == active-window.title ? "#a6da95" : "#24273a"};
margin-right: 4px;
"
(eventbox
:tooltip "${window.initial_title}: ${window.title}"
:onclick "${hyprkool} focus-window -a ${window.address}"
(image
:path "${window.icon}"
:image-height {icon-size - 6}
)
)
)
)
)
)
(defwidget Activities []
(box :orientation "horizontal"
:style "
background-color: #ed8796;
border-radius: 5px;
padding-top: 3px;
padding-bottom: 3px;
padding-left: 3px;
padding-right: 3px;
"
(for ac in activities
(box
(eventbox
:width {40}
:height {10}
:style "
background-color: ${ac.focused ? "#45475a" : "transparent"};
border-radius: 1px;
margin-right: 3px;
"
:tooltip "${ac.name}"
:onclick "${hyprkool} switch-to-activity -n '${ac.name}'"
)
)
)
)
)
(defwidget AllWorkspaces []
(box :orientation "horizontal" :spacing 5
(for workspaces in all-workspaces
(box :orientation "vertical"
:style "
background-color: ${active-window.workspace == "special:minimized" ? "#ca9ee6" : "#a6e3a1"};
border-radius: 5px;
padding-top: 3px;
padding-bottom: 3px;
padding-left: 3px;
padding-right: 3px;
"
(for row in workspaces
(box
(for ws in row
(eventbox
:width {17}
:height {10}
:style "
background-color: ${ws.focused ? "#45475a" : (arraylength(ws.named_focus) == 0 ? "transparent" : "#40803b")};
border-radius: 1px;
"
:tooltip "${ws.name}"
:onclick "${hyprkool} switch-to-workspace -n '${ws.name}'"
:onmiddleclick "${hyprkool} switch-to-workspace -w -n '${ws.name}'"
(label
:text "${ws.named_focus[0] ?: ""}"
:style "
font-size: 6px;
"
)
)
)
)
)
)
)
)
)
(defwidget Workspaces []
(box :orientation "vertical"
:style "
background-color: ${active-window.workspace == "special:minimized" ? "#ca9ee6" : "#a6e3a1"};
border-radius: 5px;
padding-top: 3px;
padding-bottom: 3px;
padding-left: 3px;
padding-right: 3px;
"
(for row in workspaces
(box
(for ws in row
(eventbox
:width {17}
:height {10}
:style "
background-color: ${ws.focused ? "#45475a" : "transparent"};
border-radius: 1px;
"
:tooltip "${ws.name}"
:onclick "${hyprkool} switch-to-workspace -n '${ws.name}'"
)
)
)
)
)
)
(defwidget Launcher []
(eventbox
:onclick "rofi -show drun -show-icons &"
(fancy-box :color "#89b4fa"
(label
:text ""
:style "
font-size: 25px;
padding-right: 9px;
"
)
)
)
)
(defwidget Submap []
(eventbox
(fancy-box :color "#f5a97f"
(label :text "${submap.submap == "" ? "normal" : submap.submap}")
)
)
)
(defwidget Stats []
(box
:space-evenly false
:spacing 5
(NetworkStat)
(BatteryStat)
(BrightnessStat)
(VolumeStat)
(MicStat)
(Cpu)
(PowerStat)
(Datetime)
)
)
(defwidget NetworkStat []
(eventbox
(fancy-box :color "#bd93f9"
(label :text " ${network.id}")
)
)
)
(defwidget Cal []
(eventbox
:onhoverlost "sleep 0.5 && eww close cal &"
(box
:space-evenly false
:orientation "vertical"
:spacing 5
:style "
margin-top: 50px;
"
(calendar :class "calendar")
)
)
)
(defwidget Datetime []
(eventbox
:onclick "eww open --toggle cal"
; :onhover "eww open cal"
(fancy-box :color "#ABE9B3"
(label :text " ${time} | ${date}")
)
)
)
(defwidget Cpu []
(eventbox
(fancy-box
:color "${
EWW_TEMPS.ACPITZ_TEMP1 >= 80 ? "#F28FAD"
: EWW_TEMPS.ACPITZ_TEMP1 >= 70 ? "#F8BD96"
: EWW_TEMPS.ACPITZ_TEMP1 > 57 ? "#ABE9B3"
: "#B5E8E0"
}"
; (label :text "CPU ${round(EWW_CPU.avg, 0)}% ")
(label :text "${EWW_TEMPS.ACPITZ_TEMP1}℃ ")
)
)
)
(defwidget PowerStat []
(eventbox
:onclick "./scripts/power-interact.sh &"
(fancy-box :color "#F28FAD"
(label :text "${
power.profile == "performance" ? " "
: power.profile == "balanced" ? " "
: " "
}")
(label :text "${power.profile}")
)
)
)
(defwidget MicStat []
(eventbox
:onscroll "./scripts/mic-interact.sh {}"
:onclick "./scripts/mic-interact.sh click"
(fancy-box :color "#FAE3B0"
(box
:style "
padding-right: 5px;
"
(label :text "${mic.muted ? '' : ''}")
)
(label :text "${mic.muted ? '' : mic.level}")
)
)
)
(defwidget VolumeStat []
(eventbox
:onscroll "./scripts/volume-interact.sh {}"
:onclick "./scripts/volume-interact.sh click"
(fancy-box :color "#f4b8e4"
(label :text "${
volume.muted ? "x"
: volume.level > 60 ? " "
: volume.level > 30 ? " "
: " "
}")
(label :text " ${volume.muted ? '' : volume.level}")
)
)
)
(defwidget BrightnessStat []
(eventbox
:onscroll "./scripts/brightness-scroll.sh {}"
(fancy-box :color "#F8BD96"
(label :text " ${brightness.level}")
)
)
)
(defwidget BatteryStat []
(eventbox
(fancy-box :color "#B5E8E0"
(label :text "${
EWW_BATTERY.BAT0.status == "Charging" ? " "
: EWW_BATTERY.BAT0.status == "Discharging" ? ""
: EWW_BATTERY.BAT0.status == "Not charging" ? " "
: ""
}")
(label :text "${
EWW_BATTERY.BAT0.capacity > 80 ? " "
: EWW_BATTERY.BAT0.capacity > 60 ? " "
: EWW_BATTERY.BAT0.capacity > 40 ? " "
: EWW_BATTERY.BAT0.capacity > 20 ? " "
: " "
}")
(label :text "${EWW_BATTERY.BAT0.capacity}%")
)
)
)
(defwidget fancy-box [color]
(box
:style "
color: black;
font-size: 17px;
font-weight: 700;
background-color: ${color};
padding-left: 8px;
padding-right: 8px;
border-radius: 10px;
"
:space-evenly false
(children)
)
)