···
83
83
property int batteryPercent: 0
84
84
property string batteryStatus: ""
85
85
property string powerProfile: ""
86
86
+
property string powerBackend: "" // "system76" or "ppd"
86
87
property string weather: ""
87
88
property int ghNotifications: 0
88
89
property int ghLastCount: 0
···
234
235
Component.onCompleted: running = true
235
236
}
236
237
238
238
+
// Detect power backend once at startup
239
239
+
Process {
240
240
+
id: powerBackendProc
241
241
+
command: ["sh", "-c", "command -v system76-power >/dev/null 2>&1 && echo system76 || echo ppd"]
242
242
+
stdout: SplitParser {
243
243
+
onRead: data => {
244
244
+
if (!data) return
245
245
+
root.powerBackend = data.trim()
246
246
+
}
247
247
+
}
248
248
+
Component.onCompleted: running = true
249
249
+
}
250
250
+
237
251
// Power profile
238
252
Process {
239
253
id: powerProc
240
240
-
command: ["sh", "-c", "powerprofilesctl get 2>/dev/null || echo unknown"]
254
254
+
command: ["sh", "-c", "if command -v system76-power >/dev/null 2>&1; then p=$(system76-power profile 2>/dev/null | grep -oiE 'performance|balanced|battery' | tr '[:upper:]' '[:lower:]'); [ \"$p\" = \"battery\" ] && p=\"power-saver\"; echo \"${p:-unknown}\"; else powerprofilesctl get 2>/dev/null || echo unknown; fi"]
241
255
stdout: SplitParser {
242
256
onRead: data => {
243
257
if (!data) return
···
416
430
if (root.powerProfile === "power-saver") return root.iconLeaf
417
431
return root.iconBalance
418
432
}
433
433
+
MouseArea {
434
434
+
anchors.fill: parent
435
435
+
cursorShape: Qt.PointingHandCursor
436
436
+
onClicked: {
437
437
+
var next = "balanced"
438
438
+
if (root.powerProfile === "balanced") next = "performance"
439
439
+
else if (root.powerProfile === "performance") next = "power-saver"
440
440
+
else next = "balanced"
441
441
+
if (root.powerBackend === "system76") {
442
442
+
var s76profile = next === "power-saver" ? "battery" : next
443
443
+
powerSetProc.command = ["system76-power", "profile", s76profile]
444
444
+
} else {
445
445
+
powerSetProc.command = ["powerprofilesctl", "set", next]
446
446
+
}
447
447
+
powerSetProc.running = true
448
448
+
root.powerProfile = next
449
449
+
}
450
450
+
}
451
451
+
}
452
452
+
453
453
+
Process {
454
454
+
id: powerSetProc
419
455
}
420
456
421
457
Rectangle { width: 1; height: 16; color: root.colOverlay0 }
···
285
285
"mqtt"
286
286
"tasmota"
287
287
"wiz"
288
288
-
"google_translate" # TTS - was missing gtts module
289
289
-
"ecobee" # Was missing pyecobee module
290
290
-
"ibeacon" # Was missing ibeacon_ble module
291
291
-
"go2rtc" # Camera streaming
292
292
-
"generic" # Generic camera integration
288
288
+
"google_translate" # TTS - was missing gtts module
289
289
+
"ecobee" # Was missing pyecobee module
290
290
+
"ibeacon" # Was missing ibeacon_ble module
291
291
+
"go2rtc" # Camera streaming
292
292
+
"generic" # Generic camera integration
293
293
];
294
294
config = {
295
295
homeassistant = {
···
385
385
settings = {
386
386
registration_enabled = false;
387
387
local = true;
388
388
-
invidious_companion = [{
389
389
-
private_url = "http://127.0.0.1:8282/companion";
390
390
-
}];
388
388
+
invidious_companion = [
389
389
+
{
390
390
+
private_url = "http://127.0.0.1:8282/companion";
391
391
+
}
392
392
+
];
391
393
invidious_companion_key = "k9x2mP4qR7wL3nYz";
392
394
};
393
395
};
···
399
401
environment = {
400
402
SERVER_SECRET_KEY = "k9x2mP4qR7wL3nYz";
401
403
};
402
402
-
extraOptions = [ "--read-only" "--cap-drop=ALL" ];
404
404
+
extraOptions = [
405
405
+
"--read-only"
406
406
+
"--cap-drop=ALL"
407
407
+
];
403
408
};
404
409
405
410
# Enable the OpenSSH daemon.