Files
nixos/Droidnix/generated/.config/quickshell/updater/shell.qml
T
2026-04-29 12:01:53 +02:00

91 lines
1.9 KiB
QML

// --- This file has been auto-generated. For permanent changes alter the appropriate block in the README.org. ---
import Quickshell
import Quickshell.Io
import QtQuick
import QtQuick.Layouts
import QtQuick.Controls
Window {
id: root
width: 600
height: 380
visible: true
property int currentStep: 0
property int totalSteps: 4
property string status: "idle"
Column {
anchors.fill: parent
anchors.margins: 16
spacing: 10
Text {
text: "System Updater"
font.pixelSize: 20
}
ProgressBar {
from: 0
to: root.totalSteps
value: root.currentStep
width: parent.width
}
Text {
text: "Step " + root.currentStep + " / " + root.totalSteps
}
Rectangle {
width: parent.width
height: 180
ListView {
id: logView
anchors.fill: parent
model: logModel
}
ListModel {
id: logModel
}
}
Row {
spacing: 10
Button {
text: "Run update"
onClicked: updater.start()
}
Button {
text: "Close"
onClicked: root.visible = false
}
}
}
Process {
id: updater
command: ["bash", "/home/henrov/.config/scripts/update-engine.sh"]
onOutput: function(data) {
logModel.append({ text: data.trim() })
if (data.startsWith("STEP:")) {
let parts = data.split(":")
root.currentStep = parseInt(parts[1])
}
if (data.startsWith("DONE")) {
root.status = "done"
}
if (data.startsWith("FAIL")) {
root.status = "error"
}
}
}
}