Regenerated

This commit is contained in:
2026-05-01 10:36:17 +02:00
parent 39fbed08cb
commit 0d616c5068
3 changed files with 640 additions and 466 deletions
+469 -411
View File
File diff suppressed because it is too large Load Diff
+69 -11
View File
@@ -3828,6 +3828,9 @@ ShellRoot {
property bool isFailed: false property bool isFailed: false
property string currentLog: "" property string currentLog: ""
property bool started: false property bool started: false
property string sudoPassword: ""
readonly property int rebuildStep: 5
readonly property var steps: [ readonly property var steps: [
{ label: "Updating flake.lock", cmd: ["nix", "flake", "update"], cwd: "/home/henrov/Repos/nixos/Droidnix" }, { label: "Updating flake.lock", cmd: ["nix", "flake", "update"], cwd: "/home/henrov/Repos/nixos/Droidnix" },
@@ -3835,7 +3838,7 @@ ShellRoot {
{ label: "Staging changes", cmd: ["git", "add", "."], cwd: "/home/henrov/Repos/nixos/Droidnix" }, { label: "Staging changes", cmd: ["git", "add", "."], cwd: "/home/henrov/Repos/nixos/Droidnix" },
{ label: "Committing changes", cmd: ["git", "commit", "-m", "Updated system"], cwd: "/home/henrov/Repos/nixos/Droidnix" }, { label: "Committing changes", cmd: ["git", "commit", "-m", "Updated system"], cwd: "/home/henrov/Repos/nixos/Droidnix" },
{ label: "Pushing to remote", cmd: ["git", "push"], cwd: "/home/henrov/Repos/nixos/Droidnix" }, { label: "Pushing to remote", cmd: ["git", "push"], cwd: "/home/henrov/Repos/nixos/Droidnix" },
{ label: "Rebuilding NixOS", cmd: ["pkexec", "nixos-rebuild", "switch", "--flake", ".#traveldroid"], cwd: "/home/henrov/Repos/nixos/Droidnix" }, { label: "Rebuilding NixOS", cmd: ["sudo", "-S", "nixos-rebuild", "switch", "--flake", ".#traveldroid"], cwd: "/home/henrov/Repos/nixos/Droidnix" },
{ label: "Reloading Hyprland", cmd: ["hyprctl", "reload"], cwd: "/home/henrov" }, { label: "Reloading Hyprland", cmd: ["hyprctl", "reload"], cwd: "/home/henrov" },
] ]
@@ -3869,6 +3872,13 @@ ShellRoot {
} }
} }
onStarted: {
if (currentStep === rebuildStep) {
stdin.write(sudoPassword + "\n")
stdin.close()
}
}
onExited: (code) => { onExited: (code) => {
if (code !== 0 && currentStep !== 3) { if (code !== 0 && currentStep !== 3) {
isFailed = true isFailed = true
@@ -3882,8 +3892,8 @@ ShellRoot {
FloatingWindow { FloatingWindow {
title: "quickshell-updater" title: "quickshell-updater"
visible: true visible: true
width: 540 width: 640
height: contentCol.implicitHeight + 32 height: contentCol.implicitHeight + 48
color: "transparent" color: "transparent"
Shortcut { Shortcut {
@@ -3916,7 +3926,7 @@ ShellRoot {
right: parent.right right: parent.right
margins: 20 margins: 20
} }
spacing: 8 spacing: 12
Text { Text {
text: " System Update" text: " System Update"
@@ -3939,14 +3949,12 @@ ShellRoot {
readonly property bool failed: isFailed && index === currentStep readonly property bool failed: isFailed && index === currentStep
readonly property bool pending: !done && !active && !failed readonly property bool pending: !done && !active && !failed
// icon
Text { Text {
font.pixelSize: 14 font.pixelSize: 14
text: failed ? "✗" : done ? "✓" : active ? "" : "○" text: failed ? "✗" : done ? "✓" : active ? "" : "○"
color: failed ? colors.red : done ? colors.green : active ? colors.yellow : colors.surface1 color: failed ? colors.red : done ? colors.green : active ? colors.yellow : colors.surface1
} }
// label
Text { Text {
text: steps[index].label text: steps[index].label
font.pixelSize: 13 font.pixelSize: 13
@@ -3955,10 +3963,55 @@ ShellRoot {
} }
} }
// Password field — only shown before start
Rectangle {
visible: !started
Layout.fillWidth: true
height: 38
radius: 8
color: colors.surface0
RowLayout {
anchors {
fill: parent
margins: 10
}
spacing: 8
Text {
text: "󰌾"
color: colors.subtext0
font.pixelSize: 14
}
TextInput {
id: passwordInput
Layout.fillWidth: true
echoMode: TextInput.Password
color: colors.text
font.pixelSize: 13
onTextChanged: sudoPassword = text
Keys.onReturnPressed: {
if (sudoPassword !== "") {
started = true
runStep(0)
}
}
}
Text {
text: sudoPassword === "" ? "enter sudo password" : ""
color: colors.surface1
font.pixelSize: 13
// manual placeholder since Qt's built-in isn't always available
}
}
}
// Log box // Log box
Rectangle { Rectangle {
Layout.fillWidth: true Layout.fillWidth: true
height: 160 height: 220
radius: 8 radius: 8
color: colors.surface0 color: colors.surface0
visible: currentLog !== "" && started visible: currentLog !== "" && started
@@ -3985,7 +4038,7 @@ ShellRoot {
Text { Text {
font.pixelSize: 12 font.pixelSize: 12
text: { text: {
if (!started) return "Press Start to begin" if (!started) return "Enter your sudo password, then press Start"
if (isFailed) return "✗ Failed at: " + steps[currentStep].label if (isFailed) return "✗ Failed at: " + steps[currentStep].label
if (currentStep === steps.length) return "✓ All done!" if (currentStep === steps.length) return "✓ All done!"
if (isRunning) return steps[currentStep].label + "…" if (isRunning) return steps[currentStep].label + "…"
@@ -3998,8 +4051,10 @@ ShellRoot {
Rectangle { Rectangle {
visible: !started visible: !started
width: 80; height: 28 width: 80
height: 28
radius: 14 radius: 14
opacity: sudoPassword === "" ? 0.4 : 1.0
gradient: Gradient { gradient: Gradient {
orientation: Gradient.Horizontal orientation: Gradient.Horizontal
GradientStop { position: 0.0; color: colors.blue } GradientStop { position: 0.0; color: colors.blue }
@@ -4014,17 +4069,20 @@ ShellRoot {
} }
MouseArea { MouseArea {
anchors.fill: parent anchors.fill: parent
cursorShape: Qt.PointingHandCursor cursorShape: sudoPassword === "" ? Qt.ArrowCursor : Qt.PointingHandCursor
onClicked: { onClicked: {
if (sudoPassword !== "") {
started = true started = true
runStep(0) runStep(0)
} }
} }
} }
}
Rectangle { Rectangle {
visible: !isRunning && started visible: !isRunning && started
width: 80; height: 28 width: 80
height: 28
radius: 14 radius: 14
color: colors.surface1 color: colors.surface1
Text { Text {
@@ -23,6 +23,9 @@ ShellRoot {
property bool isFailed: false property bool isFailed: false
property string currentLog: "" property string currentLog: ""
property bool started: false property bool started: false
property string sudoPassword: ""
readonly property int rebuildStep: 5
readonly property var steps: [ readonly property var steps: [
{ label: "Updating flake.lock", cmd: ["nix", "flake", "update"], cwd: "/home/henrov/Repos/nixos/Droidnix" }, { label: "Updating flake.lock", cmd: ["nix", "flake", "update"], cwd: "/home/henrov/Repos/nixos/Droidnix" },
@@ -30,7 +33,7 @@ ShellRoot {
{ label: "Staging changes", cmd: ["git", "add", "."], cwd: "/home/henrov/Repos/nixos/Droidnix" }, { label: "Staging changes", cmd: ["git", "add", "."], cwd: "/home/henrov/Repos/nixos/Droidnix" },
{ label: "Committing changes", cmd: ["git", "commit", "-m", "Updated system"], cwd: "/home/henrov/Repos/nixos/Droidnix" }, { label: "Committing changes", cmd: ["git", "commit", "-m", "Updated system"], cwd: "/home/henrov/Repos/nixos/Droidnix" },
{ label: "Pushing to remote", cmd: ["git", "push"], cwd: "/home/henrov/Repos/nixos/Droidnix" }, { label: "Pushing to remote", cmd: ["git", "push"], cwd: "/home/henrov/Repos/nixos/Droidnix" },
{ label: "Rebuilding NixOS", cmd: ["pkexec", "nixos-rebuild", "switch", "--flake", ".#traveldroid"], cwd: "/home/henrov/Repos/nixos/Droidnix" }, { label: "Rebuilding NixOS", cmd: ["sudo", "-S", "nixos-rebuild", "switch", "--flake", ".#traveldroid"], cwd: "/home/henrov/Repos/nixos/Droidnix" },
{ label: "Reloading Hyprland", cmd: ["hyprctl", "reload"], cwd: "/home/henrov" }, { label: "Reloading Hyprland", cmd: ["hyprctl", "reload"], cwd: "/home/henrov" },
] ]
@@ -64,6 +67,13 @@ ShellRoot {
} }
} }
onStarted: {
if (currentStep === rebuildStep) {
stdin.write(sudoPassword + "\n")
stdin.close()
}
}
onExited: (code) => { onExited: (code) => {
if (code !== 0 && currentStep !== 3) { if (code !== 0 && currentStep !== 3) {
isFailed = true isFailed = true
@@ -77,8 +87,8 @@ ShellRoot {
FloatingWindow { FloatingWindow {
title: "quickshell-updater" title: "quickshell-updater"
visible: true visible: true
width: 540 width: 640
height: contentCol.implicitHeight + 32 height: contentCol.implicitHeight + 48
color: "transparent" color: "transparent"
Shortcut { Shortcut {
@@ -111,7 +121,7 @@ ShellRoot {
right: parent.right right: parent.right
margins: 20 margins: 20
} }
spacing: 8 spacing: 12
Text { Text {
text: " System Update" text: " System Update"
@@ -134,14 +144,12 @@ ShellRoot {
readonly property bool failed: isFailed && index === currentStep readonly property bool failed: isFailed && index === currentStep
readonly property bool pending: !done && !active && !failed readonly property bool pending: !done && !active && !failed
// icon
Text { Text {
font.pixelSize: 14 font.pixelSize: 14
text: failed ? "✗" : done ? "✓" : active ? "" : "○" text: failed ? "✗" : done ? "✓" : active ? "" : "○"
color: failed ? colors.red : done ? colors.green : active ? colors.yellow : colors.surface1 color: failed ? colors.red : done ? colors.green : active ? colors.yellow : colors.surface1
} }
// label
Text { Text {
text: steps[index].label text: steps[index].label
font.pixelSize: 13 font.pixelSize: 13
@@ -150,10 +158,55 @@ ShellRoot {
} }
} }
// Password field — only shown before start
Rectangle {
visible: !started
Layout.fillWidth: true
height: 38
radius: 8
color: colors.surface0
RowLayout {
anchors {
fill: parent
margins: 10
}
spacing: 8
Text {
text: "󰌾"
color: colors.subtext0
font.pixelSize: 14
}
TextInput {
id: passwordInput
Layout.fillWidth: true
echoMode: TextInput.Password
color: colors.text
font.pixelSize: 13
onTextChanged: sudoPassword = text
Keys.onReturnPressed: {
if (sudoPassword !== "") {
started = true
runStep(0)
}
}
}
Text {
text: sudoPassword === "" ? "enter sudo password" : ""
color: colors.surface1
font.pixelSize: 13
// manual placeholder since Qt's built-in isn't always available
}
}
}
// Log box // Log box
Rectangle { Rectangle {
Layout.fillWidth: true Layout.fillWidth: true
height: 160 height: 220
radius: 8 radius: 8
color: colors.surface0 color: colors.surface0
visible: currentLog !== "" && started visible: currentLog !== "" && started
@@ -180,7 +233,7 @@ ShellRoot {
Text { Text {
font.pixelSize: 12 font.pixelSize: 12
text: { text: {
if (!started) return "Press Start to begin" if (!started) return "Enter your sudo password, then press Start"
if (isFailed) return "✗ Failed at: " + steps[currentStep].label if (isFailed) return "✗ Failed at: " + steps[currentStep].label
if (currentStep === steps.length) return "✓ All done!" if (currentStep === steps.length) return "✓ All done!"
if (isRunning) return steps[currentStep].label + "…" if (isRunning) return steps[currentStep].label + "…"
@@ -193,8 +246,10 @@ ShellRoot {
Rectangle { Rectangle {
visible: !started visible: !started
width: 80; height: 28 width: 80
height: 28
radius: 14 radius: 14
opacity: sudoPassword === "" ? 0.4 : 1.0
gradient: Gradient { gradient: Gradient {
orientation: Gradient.Horizontal orientation: Gradient.Horizontal
GradientStop { position: 0.0; color: colors.blue } GradientStop { position: 0.0; color: colors.blue }
@@ -209,17 +264,20 @@ ShellRoot {
} }
MouseArea { MouseArea {
anchors.fill: parent anchors.fill: parent
cursorShape: Qt.PointingHandCursor cursorShape: sudoPassword === "" ? Qt.ArrowCursor : Qt.PointingHandCursor
onClicked: { onClicked: {
if (sudoPassword !== "") {
started = true started = true
runStep(0) runStep(0)
} }
} }
} }
}
Rectangle { Rectangle {
visible: !isRunning && started visible: !isRunning && started
width: 80; height: 28 width: 80
height: 28
radius: 14 radius: 14
color: colors.surface1 color: colors.surface1
Text { Text {