alpha
Login
or
Join now
seanaye.bsky.social
/
nixos-config
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
me like nix
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
Overview
Issues
Pulls
Pipelines
replace waybar with quickshell
author
Sean Aye
date
3 months ago
(Mar 22, 2026, 8:03 PM -0400)
commit
a17d0da5
a17d0da56141cd8e14913022560b62f01e2dfe60
parent
b2c51c20
b2c51c20e9e92ff0c2203852db94b03f697b5eb0
change-id
pwpsqxrp
pwpsqxrputkwmvxxuyzlvwqskqzosnkl
+404
-219
2 changed files
Expand all
Collapse all
Unified
Split
hosts
common
home.nix
quickshell
shell.qml
+6
-219
hosts/common/home.nix
Reviewed
···
176
176
{ command = [ "xwayland-satellite" ]; }
177
177
{ command = [ "swww-daemon" ]; }
178
178
{ command = [ "mako" ]; }
179
179
-
{ command = [ "waybar" ]; }
179
179
+
{ command = [ "quickshell" "-p" "${./quickshell/shell.qml}" ]; }
180
180
{ command = [ "wl-paste --watch cliphist store" ]; }
181
181
];
182
182
environment = {
···
192
192
"libsoup-2.74.3"
193
193
];
194
194
195
195
-
programs.waybar = {
196
196
-
enable = true;
197
197
-
settings = {
198
198
-
mainBar = {
199
199
-
height = 8;
200
200
-
spacing = 0;
201
201
-
202
202
-
modules-left = [
203
203
-
"custom/media"
204
204
-
];
205
205
-
206
206
-
modules-center = [
207
207
-
"clock"
208
208
-
];
209
209
-
210
210
-
modules-right = [
211
211
-
"mpd"
212
212
-
"pulseaudio"
213
213
-
"network"
214
214
-
"power-profiles-daemon"
215
215
-
"cpu"
216
216
-
"memory"
217
217
-
"temperature"
218
218
-
"backlight"
219
219
-
"sway/language"
220
220
-
"battery"
221
221
-
"battery#bat2"
222
222
-
"custom/power"
223
223
-
];
224
224
-
225
225
-
"keyboard-state" = {
226
226
-
numlock = true;
227
227
-
capslock = true;
228
228
-
format = "{name} {icon}";
229
229
-
format-icons = {
230
230
-
locked = " ";
231
231
-
unlocked = " ";
232
232
-
};
233
233
-
};
234
234
-
235
235
-
mpd = {
236
236
-
format = "{stateIcon} {consumeIcon}{randomIcon}{repeatIcon}{singleIcon}{artist} - {album} - {title} ({elapsedTime:%M:%S}/{totalTime:%M:%S}) ⸨{songPosition}|{queueLength}⸩ {volume}% ";
237
237
-
format-disconnected = "Disconnected ";
238
238
-
format-stopped = "{consumeIcon}{randomIcon}{repeatIcon}{singleIcon}Stopped ";
239
239
-
unknown-tag = "N/A";
240
240
-
interval = 5;
241
241
-
consume-icons = {
242
242
-
on = " ";
243
243
-
};
244
244
-
random-icons = {
245
245
-
off = "<span color=\"#f53c3c\"></span> ";
246
246
-
on = " ";
247
247
-
};
248
248
-
repeat-icons = {
249
249
-
on = " ";
250
250
-
};
251
251
-
single-icons = {
252
252
-
on = "1 ";
253
253
-
};
254
254
-
state-icons = {
255
255
-
paused = "";
256
256
-
playing = "";
257
257
-
};
258
258
-
tooltip-format = "MPD (connected)";
259
259
-
tooltip-format-disconnected = "MPD (disconnected)";
260
260
-
};
261
261
-
262
262
-
idle_inhibitor = {
263
263
-
format = "{icon}";
264
264
-
format-icons = {
265
265
-
activated = " ";
266
266
-
deactivated = " ";
267
267
-
};
268
268
-
};
269
269
-
270
270
-
tray = {
271
271
-
spacing = 10;
272
272
-
};
273
273
-
274
274
-
clock = {
275
275
-
format = "{:%d-%m-%Y %H:%M}";
276
276
-
tooltip-format = "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>";
277
277
-
format-alt = "{:%Y-%m-%d %H:%M:%S}";
278
278
-
};
279
279
-
280
280
-
cpu = {
281
281
-
format = "{usage}% ";
282
282
-
tooltip = false;
283
283
-
};
284
284
-
285
285
-
memory = {
286
286
-
format = "{}% ";
287
287
-
};
288
288
-
289
289
-
temperature = {
290
290
-
critical-threshold = 80;
291
291
-
format = "{temperatureC}°C {icon}";
292
292
-
format-icons = [
293
293
-
""
294
294
-
""
295
295
-
""
296
296
-
];
297
297
-
};
298
298
-
299
299
-
backlight = {
300
300
-
format = "{percent}% {icon}";
301
301
-
format-icons = [
302
302
-
""
303
303
-
""
304
304
-
""
305
305
-
""
306
306
-
""
307
307
-
""
308
308
-
""
309
309
-
""
310
310
-
""
311
311
-
];
312
312
-
};
313
313
-
314
314
-
battery = {
315
315
-
states = {
316
316
-
warning = 30;
317
317
-
critical = 15;
318
318
-
};
319
319
-
format = "{capacity}% {icon}";
320
320
-
format-full = "{capacity}% {icon}";
321
321
-
format-charging = "{capacity}% ";
322
322
-
format-plugged = "{capacity}% ";
323
323
-
format-alt = "{time} {icon}";
324
324
-
format-icons = [
325
325
-
""
326
326
-
""
327
327
-
""
328
328
-
""
329
329
-
""
330
330
-
];
331
331
-
};
332
332
-
333
333
-
"battery#bat2" = {
334
334
-
bat = "BAT2";
335
335
-
};
336
336
-
337
337
-
"power-profiles-daemon" = {
338
338
-
format = "{icon}";
339
339
-
tooltip-format = "Power profile: {profile}\nDriver: {driver}";
340
340
-
tooltip = true;
341
341
-
format-icons = {
342
342
-
default = "";
343
343
-
performance = "";
344
344
-
balanced = " ";
345
345
-
power-saver = " ";
346
346
-
};
347
347
-
};
348
348
-
349
349
-
network = {
350
350
-
format-wifi = "{essid} ({signalStrength}%) ";
351
351
-
format-ethernet = "{ipaddr}/{cidr} ";
352
352
-
tooltip-format = "{ifname} via {gwaddr} ";
353
353
-
format-linked = "{ifname} (No IP) ";
354
354
-
format-disconnected = "Disconnected ⚠";
355
355
-
format-alt = "{ifname}: {ipaddr}/{cidr}";
356
356
-
};
357
357
-
358
358
-
pulseaudio = {
359
359
-
format = "{volume}% {icon} {format_source}";
360
360
-
format-bluetooth = "{volume}% {icon} {format_source}";
361
361
-
format-bluetooth-muted = " {icon} {format_source}";
362
362
-
format-muted = " {format_source}";
363
363
-
format-source = "{volume}% ";
364
364
-
format-source-muted = " ";
365
365
-
format-icons = {
366
366
-
headphone = "";
367
367
-
hands-free = "";
368
368
-
headset = "";
369
369
-
phone = "";
370
370
-
portable = "";
371
371
-
car = "";
372
372
-
default = [
373
373
-
""
374
374
-
" "
375
375
-
" "
376
376
-
];
377
377
-
};
378
378
-
on-click = "pavucontrol";
379
379
-
};
380
380
-
381
381
-
"custom/media" = {
382
382
-
format = "{icon} {text}";
383
383
-
return-type = "json";
384
384
-
max-length = 40;
385
385
-
format-icons = {
386
386
-
spotify = " ";
387
387
-
default = "🎜 ";
388
388
-
};
389
389
-
escape = true;
390
390
-
exec = "$HOME/.config/waybar/mediaplayer.py 2> /dev/null";
391
391
-
};
392
392
-
393
393
-
"custom/power" = {
394
394
-
format = "⏻ ";
395
395
-
tooltip = false;
396
396
-
menu = "on-click";
397
397
-
menu-file = "${./waybar/power_menu.xml}";
398
398
-
menu-actions = {
399
399
-
shutdown = "shutdown";
400
400
-
reboot = "reboot";
401
401
-
suspend = "systemctl suspend";
402
402
-
hibernate = "systemctl hibernate";
403
403
-
};
404
404
-
};
405
405
-
};
406
406
-
};
407
407
-
style = builtins.readFile ./waybar/style.css;
408
408
-
};
195
195
+
# Quickshell status bar (QML config in ./quickshell/shell.qml)
409
196
410
197
programs.ssh = {
411
198
enable = true;
···
439
226
fuzzel # Application launcher
440
227
bemoji # emoji picker
441
228
networkmanager_dmenu # network picker for fuzzel
442
442
-
waybar # Status bar (highly recommended)
229
229
+
quickshell # Status bar (QML-based)
443
230
mako # Notification daemon
444
231
swww # For setting wallpapers
445
232
cliphist # Clipboard history manager
···
478
265
atuin
479
266
480
267
# --- FONTS ARE IMPORTANT ---
481
481
-
# Berkeley Mono is the main system font, keeping JetBrains and Font Awesome for waybar
482
482
-
font-awesome # For icons in waybar
268
268
+
# Berkeley Mono is the main system font, keeping JetBrains and Font Awesome for icons
269
269
+
font-awesome
483
270
noto-fonts
484
271
noto-fonts-cjk-sans
485
272
noto-fonts-color-emoji
486
273
nerd-fonts.jetbrains-mono
487
487
-
nerd-fonts.symbols-only # Additional Nerd Font symbols for waybar
274
274
+
nerd-fonts.symbols-only
488
275
# --- POLKIT AGENT (for 1Password GUI, etc.) ---
489
276
lxqt.lxqt-policykit # Lightweight polkit agent
490
277
];
+398
hosts/common/quickshell/shell.qml
Reviewed
···
1
1
+
import Quickshell
2
2
+
import Quickshell.Wayland
3
3
+
import Quickshell.Io
4
4
+
import QtQuick
5
5
+
import QtQuick.Layouts
6
6
+
7
7
+
ShellRoot {
8
8
+
PanelWindow {
9
9
+
id: root
10
10
+
11
11
+
// Catppuccin Frappe palette
12
12
+
readonly property color colBase: "#303446"
13
13
+
readonly property color colMantle: "#292c3c"
14
14
+
readonly property color colSurface0: "#414559"
15
15
+
readonly property color colText: "#c6d0f5"
16
16
+
readonly property color colSubtext0: "#a5adce"
17
17
+
readonly property color colOverlay0: "#737994"
18
18
+
readonly property color colBlue: "#8caaee"
19
19
+
readonly property color colGreen: "#a6d189"
20
20
+
readonly property color colPeach: "#ef9f76"
21
21
+
readonly property color colMauve: "#ca9ee6"
22
22
+
readonly property color colRed: "#e78284"
23
23
+
readonly property color colYellow: "#e5c890"
24
24
+
readonly property color colMaroon: "#ea999c"
25
25
+
readonly property color colLavender: "#babbf1"
26
26
+
readonly property color colSky: "#99d1db"
27
27
+
readonly property color colSapphire: "#85c1dc"
28
28
+
29
29
+
readonly property string fontFamily: "BerkeleyMono Nerd Font"
30
30
+
readonly property int fontSize: 14
31
31
+
32
32
+
// Nerd Font icons (using Unicode escapes)
33
33
+
// Volume
34
34
+
readonly property string iconVolHigh: "\uf028"
35
35
+
readonly property string iconVolLow: "\uf027"
36
36
+
readonly property string iconVolMute: "\uf6a9"
37
37
+
// Network
38
38
+
readonly property string iconWifi: "\uf1eb"
39
39
+
// Power profiles
40
40
+
readonly property string iconBolt: "\uf0e7"
41
41
+
readonly property string iconBalance: "\uf24e"
42
42
+
readonly property string iconLeaf: "\uf06c"
43
43
+
// CPU
44
44
+
readonly property string iconCpu: "\uf2db"
45
45
+
// Memory
46
46
+
readonly property string iconMem: "\uefc5"
47
47
+
// Temperature
48
48
+
readonly property string iconTempLow: "\uf2cb"
49
49
+
readonly property string iconTempMed: "\uf2c9"
50
50
+
readonly property string iconTempHigh: "\uf2c7"
51
51
+
// Backlight
52
52
+
readonly property string iconSun: "\uf185"
53
53
+
// Battery
54
54
+
readonly property string iconBatEmpty: "\uf244"
55
55
+
readonly property string iconBatQuarter: "\uf243"
56
56
+
readonly property string iconBatHalf: "\uf242"
57
57
+
readonly property string iconBatThreeQ: "\uf241"
58
58
+
readonly property string iconBatFull: "\uf240"
59
59
+
readonly property string iconBatCharge: "\uf0e7"
60
60
+
// Power
61
61
+
readonly property string iconPower: "\u23fb"
62
62
+
63
63
+
// System data
64
64
+
property int cpuUsage: 0
65
65
+
property int memUsage: 0
66
66
+
property int temperature: 0
67
67
+
property var lastCpuIdle: 0
68
68
+
property var lastCpuTotal: 0
69
69
+
property string networkName: ""
70
70
+
property int networkStrength: 0
71
71
+
property bool networkConnected: false
72
72
+
property int volume: 0
73
73
+
property bool volumeMuted: false
74
74
+
property int brightness: 0
75
75
+
property int batteryPercent: 0
76
76
+
property string batteryStatus: ""
77
77
+
property string powerProfile: ""
78
78
+
79
79
+
anchors {
80
80
+
top: true
81
81
+
left: true
82
82
+
right: true
83
83
+
}
84
84
+
implicitHeight: 38
85
85
+
color: "transparent"
86
86
+
87
87
+
// CPU process
88
88
+
Process {
89
89
+
id: cpuProc
90
90
+
command: ["sh", "-c", "head -1 /proc/stat"]
91
91
+
stdout: SplitParser {
92
92
+
onRead: data => {
93
93
+
if (!data) return
94
94
+
var p = data.trim().split(/\s+/)
95
95
+
var idle = parseInt(p[4]) + parseInt(p[5])
96
96
+
var total = p.slice(1, 8).reduce((a, b) => a + parseInt(b), 0)
97
97
+
if (root.lastCpuTotal > 0) {
98
98
+
root.cpuUsage = Math.round(100 * (1 - (idle - root.lastCpuIdle) / (total - root.lastCpuTotal)))
99
99
+
}
100
100
+
root.lastCpuTotal = total
101
101
+
root.lastCpuIdle = idle
102
102
+
}
103
103
+
}
104
104
+
Component.onCompleted: running = true
105
105
+
}
106
106
+
107
107
+
// Memory process
108
108
+
Process {
109
109
+
id: memProc
110
110
+
command: ["sh", "-c", "free | grep Mem"]
111
111
+
stdout: SplitParser {
112
112
+
onRead: data => {
113
113
+
if (!data) return
114
114
+
var parts = data.trim().split(/\s+/)
115
115
+
var total = parseInt(parts[1]) || 1
116
116
+
var used = parseInt(parts[2]) || 0
117
117
+
root.memUsage = Math.round(100 * used / total)
118
118
+
}
119
119
+
}
120
120
+
Component.onCompleted: running = true
121
121
+
}
122
122
+
123
123
+
// Temperature
124
124
+
Process {
125
125
+
id: tempProc
126
126
+
command: ["sh", "-c", "cat /sys/class/thermal/thermal_zone0/temp 2>/dev/null || echo 0"]
127
127
+
stdout: SplitParser {
128
128
+
onRead: data => {
129
129
+
if (!data) return
130
130
+
root.temperature = Math.round(parseInt(data.trim()) / 1000)
131
131
+
}
132
132
+
}
133
133
+
Component.onCompleted: running = true
134
134
+
}
135
135
+
136
136
+
// Network
137
137
+
Process {
138
138
+
id: netProc
139
139
+
command: ["sh", "-c", "nmcli -t -f ACTIVE,SSID,SIGNAL dev wifi | grep '^yes' | head -1"]
140
140
+
stdout: SplitParser {
141
141
+
onRead: data => {
142
142
+
if (!data || data.trim() === "") {
143
143
+
root.networkConnected = false
144
144
+
root.networkName = "Disconnected"
145
145
+
root.networkStrength = 0
146
146
+
return
147
147
+
}
148
148
+
var parts = data.trim().split(":")
149
149
+
root.networkConnected = true
150
150
+
root.networkName = parts[1] || ""
151
151
+
root.networkStrength = parseInt(parts[2]) || 0
152
152
+
}
153
153
+
}
154
154
+
Component.onCompleted: running = true
155
155
+
}
156
156
+
157
157
+
// Volume
158
158
+
Process {
159
159
+
id: volProc
160
160
+
command: ["sh", "-c", "wpctl get-volume @DEFAULT_AUDIO_SINK@"]
161
161
+
stdout: SplitParser {
162
162
+
onRead: data => {
163
163
+
if (!data) return
164
164
+
root.volumeMuted = data.indexOf("[MUTED]") !== -1
165
165
+
var match = data.match(/Volume:\s+([\d.]+)/)
166
166
+
if (match) {
167
167
+
root.volume = Math.round(parseFloat(match[1]) * 100)
168
168
+
}
169
169
+
}
170
170
+
}
171
171
+
Component.onCompleted: running = true
172
172
+
}
173
173
+
174
174
+
// Brightness
175
175
+
Process {
176
176
+
id: brightProc
177
177
+
command: ["sh", "-c", "brightnessctl -m | cut -d, -f4 | tr -d '%'"]
178
178
+
stdout: SplitParser {
179
179
+
onRead: data => {
180
180
+
if (!data) return
181
181
+
root.brightness = parseInt(data.trim()) || 0
182
182
+
}
183
183
+
}
184
184
+
Component.onCompleted: running = true
185
185
+
}
186
186
+
187
187
+
// Battery
188
188
+
Process {
189
189
+
id: batProc
190
190
+
command: ["sh", "-c", "cat /sys/class/power_supply/BAT1/capacity 2>/dev/null || echo 0"]
191
191
+
stdout: SplitParser {
192
192
+
onRead: data => {
193
193
+
if (!data) return
194
194
+
root.batteryPercent = parseInt(data.trim()) || 0
195
195
+
}
196
196
+
}
197
197
+
Component.onCompleted: running = true
198
198
+
}
199
199
+
200
200
+
Process {
201
201
+
id: batStatusProc
202
202
+
command: ["sh", "-c", "cat /sys/class/power_supply/BAT1/status 2>/dev/null || echo Unknown"]
203
203
+
stdout: SplitParser {
204
204
+
onRead: data => {
205
205
+
if (!data) return
206
206
+
root.batteryStatus = data.trim()
207
207
+
}
208
208
+
}
209
209
+
Component.onCompleted: running = true
210
210
+
}
211
211
+
212
212
+
// Power profile
213
213
+
Process {
214
214
+
id: powerProc
215
215
+
command: ["sh", "-c", "powerprofilesctl get 2>/dev/null || echo unknown"]
216
216
+
stdout: SplitParser {
217
217
+
onRead: data => {
218
218
+
if (!data) return
219
219
+
root.powerProfile = data.trim()
220
220
+
}
221
221
+
}
222
222
+
Component.onCompleted: running = true
223
223
+
}
224
224
+
225
225
+
// Update timer
226
226
+
Timer {
227
227
+
interval: 2000
228
228
+
running: true
229
229
+
repeat: true
230
230
+
onTriggered: {
231
231
+
cpuProc.running = true
232
232
+
memProc.running = true
233
233
+
tempProc.running = true
234
234
+
netProc.running = true
235
235
+
volProc.running = true
236
236
+
brightProc.running = true
237
237
+
batProc.running = true
238
238
+
batStatusProc.running = true
239
239
+
powerProc.running = true
240
240
+
}
241
241
+
}
242
242
+
243
243
+
RowLayout {
244
244
+
anchors.fill: parent
245
245
+
anchors.leftMargin: 12
246
246
+
anchors.rightMargin: 12
247
247
+
spacing: 0
248
248
+
249
249
+
// Left section
250
250
+
RowLayout {
251
251
+
spacing: 0
252
252
+
253
253
+
Rectangle {
254
254
+
Layout.preferredHeight: 30
255
255
+
Layout.preferredWidth: clockText.implicitWidth + 24
256
256
+
radius: 15
257
257
+
color: root.colSurface0
258
258
+
259
259
+
Text {
260
260
+
id: clockText
261
261
+
anchors.centerIn: parent
262
262
+
color: root.colBlue
263
263
+
font { family: root.fontFamily; pixelSize: root.fontSize }
264
264
+
text: Qt.formatDateTime(new Date(), "dd-MM-yyyy HH:mm")
265
265
+
Timer {
266
266
+
interval: 1000
267
267
+
running: true
268
268
+
repeat: true
269
269
+
onTriggered: clockText.text = Qt.formatDateTime(new Date(), "dd-MM-yyyy HH:mm")
270
270
+
}
271
271
+
}
272
272
+
}
273
273
+
}
274
274
+
275
275
+
Item { Layout.fillWidth: true }
276
276
+
277
277
+
// Right section
278
278
+
RowLayout {
279
279
+
spacing: 8
280
280
+
281
281
+
Rectangle {
282
282
+
Layout.preferredHeight: 30
283
283
+
Layout.preferredWidth: rightRow.implicitWidth + 24
284
284
+
radius: 15
285
285
+
color: root.colSurface0
286
286
+
287
287
+
RowLayout {
288
288
+
id: rightRow
289
289
+
anchors.centerIn: parent
290
290
+
spacing: 12
291
291
+
292
292
+
// Volume
293
293
+
Text {
294
294
+
color: root.colMaroon
295
295
+
font { family: root.fontFamily; pixelSize: root.fontSize }
296
296
+
text: root.volume + "% " + (root.volumeMuted ? root.iconVolMute : (root.volume > 50 ? root.iconVolHigh : root.iconVolLow))
297
297
+
}
298
298
+
299
299
+
Rectangle { width: 1; height: 16; color: root.colOverlay0 }
300
300
+
301
301
+
// Network
302
302
+
Text {
303
303
+
color: root.colGreen
304
304
+
font { family: root.fontFamily; pixelSize: root.fontSize }
305
305
+
text: root.networkConnected ? root.networkName + " (" + root.networkStrength + "%) " + root.iconWifi : "Disconnected \u26a0"
306
306
+
}
307
307
+
308
308
+
Rectangle { width: 1; height: 16; color: root.colOverlay0 }
309
309
+
310
310
+
// Power Profile
311
311
+
Text {
312
312
+
color: root.colText
313
313
+
font { family: root.fontFamily; pixelSize: root.fontSize }
314
314
+
text: {
315
315
+
if (root.powerProfile === "performance") return root.iconBolt
316
316
+
if (root.powerProfile === "balanced") return root.iconBalance
317
317
+
if (root.powerProfile === "power-saver") return root.iconLeaf
318
318
+
return root.iconBalance
319
319
+
}
320
320
+
}
321
321
+
322
322
+
Rectangle { width: 1; height: 16; color: root.colOverlay0 }
323
323
+
324
324
+
// CPU
325
325
+
Text {
326
326
+
color: root.colPeach
327
327
+
font { family: root.fontFamily; pixelSize: root.fontSize }
328
328
+
text: root.cpuUsage + "% " + root.iconCpu
329
329
+
}
330
330
+
331
331
+
Rectangle { width: 1; height: 16; color: root.colOverlay0 }
332
332
+
333
333
+
// Memory
334
334
+
Text {
335
335
+
color: root.colMauve
336
336
+
font { family: root.fontFamily; pixelSize: root.fontSize }
337
337
+
text: root.memUsage + "% " + root.iconMem
338
338
+
}
339
339
+
340
340
+
Rectangle { width: 1; height: 16; color: root.colOverlay0 }
341
341
+
342
342
+
// Temperature
343
343
+
Text {
344
344
+
color: root.colRed
345
345
+
font { family: root.fontFamily; pixelSize: root.fontSize }
346
346
+
text: {
347
347
+
var icon = root.temperature >= 80 ? root.iconTempHigh : (root.temperature >= 50 ? root.iconTempMed : root.iconTempLow)
348
348
+
return root.temperature + "\u00b0C " + icon
349
349
+
}
350
350
+
}
351
351
+
352
352
+
Rectangle { width: 1; height: 16; color: root.colOverlay0 }
353
353
+
354
354
+
// Backlight
355
355
+
Text {
356
356
+
color: root.colYellow
357
357
+
font { family: root.fontFamily; pixelSize: root.fontSize }
358
358
+
text: root.brightness + "% " + root.iconSun
359
359
+
}
360
360
+
361
361
+
Rectangle { width: 1; height: 16; color: root.colOverlay0 }
362
362
+
363
363
+
// Battery
364
364
+
Text {
365
365
+
color: {
366
366
+
if (root.batteryStatus === "Charging") return root.colGreen
367
367
+
if (root.batteryPercent <= 15) return root.colRed
368
368
+
if (root.batteryPercent <= 30) return root.colRed
369
369
+
return root.colGreen
370
370
+
}
371
371
+
font { family: root.fontFamily; pixelSize: root.fontSize }
372
372
+
text: {
373
373
+
var icon
374
374
+
if (root.batteryStatus === "Charging") {
375
375
+
icon = root.iconBatCharge
376
376
+
} else {
377
377
+
var icons = [root.iconBatEmpty, root.iconBatQuarter, root.iconBatHalf, root.iconBatThreeQ, root.iconBatFull]
378
378
+
var idx = Math.min(Math.floor(root.batteryPercent / 25), 4)
379
379
+
icon = icons[idx]
380
380
+
}
381
381
+
return root.batteryPercent + "% " + icon
382
382
+
}
383
383
+
}
384
384
+
385
385
+
Rectangle { width: 1; height: 16; color: root.colOverlay0 }
386
386
+
387
387
+
// Power button
388
388
+
Text {
389
389
+
color: root.colRed
390
390
+
font { family: root.fontFamily; pixelSize: root.fontSize }
391
391
+
text: root.iconPower
392
392
+
}
393
393
+
}
394
394
+
}
395
395
+
}
396
396
+
}
397
397
+
}
398
398
+
}