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
;; Eww Bar Configuration
(deflisten workspaces :initial "[]"
"bash ~/.config/eww/scripts/get-workspaces.sh")
(deflisten current-mode :initial "default"
"~/.config/eww/scripts/i3-mode.sh")
;; Definisi variable untuk window title
(defpoll active_window :interval "1s"
"~/.config/eww/scripts/xwindow-clickable.sh")
;; Definisi variable untuk WiFi
(defpoll system_status :interval "2s"
:initial '{"wifi":"","brightness":"","volume":""}'
"~/.config/eww/scripts/wifi-status.sh")
;; Variable untuk waktu
(defpoll time :interval "1s"
"date '+%H:%M'")
(defwidget mode-indicator []
(box :class "mode-indicator"
:valign "center"
:vexpand false
:visible {current-mode != "default"}
(label :class "indicator-i3" :text "${current-mode}")))
(defwidget workspaces_widget []
(eventbox
:onscroll "i3-msg workspace {}"
(box
:class "i3-section"
:spacing 2
:valign "center"
:vexpand false
(for ws in workspaces
(button
:class "ws-btn ${ws.focused ? 'focused' : ''} ${ws.urgent ? 'urgent' : ''} ${ws.visible ? 'visible' : ''}"
:onclick "i3-msg 'workspace number ${ws.num}'"
"${ws.name}")))))
;; Main Bar Widget
(defwidget bar-widget []
(centerbox :class "bar-container"
:orientation "h"
:valign "center"
:vexpand false
;; Bagian Kiri (start)
(box :class "bar-section-left"
:orientation "h"
:space-evenly false
:halign "start"
:spacing 10
:valign "center"
:vexpand false
(button :onclick "~/.config/rofi/powermenu/type-5/powermenu.sh &"
(label :class "left-text"
:text " "))
(workspaces_widget)
(label :class "weather-bar" :text WEATHER_ICON)
(label :class "text-weather-bar" :text WEATHER_DESC)
(mode-indicator)
)
;; Bagian Tengah (center)
(box :class "bar-section-center"
:orientation "h"
:halign "center"
:space-evenly false
:valign "center"
:vexpand false
(button :onclick "~/.config/eww/scripts/toggle_dashboard.sh"
:timeout "2s"
(box :class "windows-center-bar"
:orientation "h"
:halign "center"
:space-evenly false
:valign "center"
:vexpand false
(label :class "icon-center-bar"
:text " ")
(label :class "center-text"
:text active_window)
)
)
)
;; Bagian Kanan (end)
(box :class "bar-section-right"
:orientation "h"
:space-evenly false
:halign "end"
:spacing 5
:valign "center"
:vexpand false
(box :class "system-tray-bar"
:valign "center"
:vexpand false
(systray :icon-size 12 :spacing 8)
)
(button :onclick "~/.config/eww/scripts/toggle-control-center.sh"
:timeout "2s"
(box :class "status-section-right"
:orientation "h"
:space-evenly false
:halign "end"
:spacing 10
:valign "center"
:vexpand false
(label :class "right-text" :text {system_status.wifi})
(label :class "right-text" :text {system_status.brightness})
(label :class "right-text" :text {system_status.volume})
)
)
(box :class "time-bar"
:orientation "h"
:space-evenly false
:spacing 0
:valign "center"
:vexpand false
(label :class "time-icon"
:text " ")
(label :class "time-text" :valign "center" :vexpand false
:text time)
)
)
)
)
;; Window Definition
(defwindow bar
:monitor 0
:geometry (geometry
:x "14px"
:y "10px"
:width "98%"
:height "27px"
:anchor "top left")
:stacking "fg"
:exclusive false
:focusable false
:windowtype "dock"
:wm-ignore true
(bar-widget))