Regenerated
This commit is contained in:
+480
-422
File diff suppressed because it is too large
Load Diff
+80
-22
@@ -3828,15 +3828,18 @@ ShellRoot {
|
||||
property bool isFailed: false
|
||||
property string currentLog: ""
|
||||
property bool started: false
|
||||
property string sudoPassword: ""
|
||||
|
||||
readonly property int rebuildStep: 5
|
||||
|
||||
readonly property var steps: [
|
||||
{ label: "Updating flake.lock", cmd: ["nix", "flake", "update"], cwd: "/home/henrov/Repos/nixos/Droidnix" },
|
||||
{ label: "Updating Flatpaks", cmd: ["flatpak", "update", "-y"], cwd: "/home/henrov" },
|
||||
{ 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: "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: "Reloading Hyprland", cmd: ["hyprctl", "reload"], cwd: "/home/henrov" },
|
||||
{ label: "Updating flake.lock", cmd: ["nix", "flake", "update"], cwd: "/home/henrov/Repos/nixos/Droidnix" },
|
||||
{ label: "Updating Flatpaks", cmd: ["flatpak", "update", "-y"], cwd: "/home/henrov" },
|
||||
{ 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: "Pushing to remote", cmd: ["git", "push"], 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" },
|
||||
]
|
||||
|
||||
function runStep(index) {
|
||||
@@ -3869,6 +3872,13 @@ ShellRoot {
|
||||
}
|
||||
}
|
||||
|
||||
onStarted: {
|
||||
if (currentStep === rebuildStep) {
|
||||
stdin.write(sudoPassword + "\n")
|
||||
stdin.close()
|
||||
}
|
||||
}
|
||||
|
||||
onExited: (code) => {
|
||||
if (code !== 0 && currentStep !== 3) {
|
||||
isFailed = true
|
||||
@@ -3882,8 +3892,8 @@ ShellRoot {
|
||||
FloatingWindow {
|
||||
title: "quickshell-updater"
|
||||
visible: true
|
||||
width: 540
|
||||
height: contentCol.implicitHeight + 32
|
||||
width: 640
|
||||
height: contentCol.implicitHeight + 48
|
||||
color: "transparent"
|
||||
|
||||
Shortcut {
|
||||
@@ -3916,7 +3926,7 @@ ShellRoot {
|
||||
right: parent.right
|
||||
margins: 20
|
||||
}
|
||||
spacing: 8
|
||||
spacing: 12
|
||||
|
||||
Text {
|
||||
text: " System Update"
|
||||
@@ -3939,14 +3949,12 @@ ShellRoot {
|
||||
readonly property bool failed: isFailed && index === currentStep
|
||||
readonly property bool pending: !done && !active && !failed
|
||||
|
||||
// icon
|
||||
Text {
|
||||
font.pixelSize: 14
|
||||
text: failed ? "✗" : done ? "✓" : active ? "›" : "○"
|
||||
color: failed ? colors.red : done ? colors.green : active ? colors.yellow : colors.surface1
|
||||
}
|
||||
|
||||
// label
|
||||
Text {
|
||||
text: steps[index].label
|
||||
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
|
||||
Rectangle {
|
||||
Layout.fillWidth: true
|
||||
height: 160
|
||||
height: 220
|
||||
radius: 8
|
||||
color: colors.surface0
|
||||
visible: currentLog !== "" && started
|
||||
@@ -3985,7 +4038,7 @@ ShellRoot {
|
||||
Text {
|
||||
font.pixelSize: 12
|
||||
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 (currentStep === steps.length) return "✓ All done!"
|
||||
if (isRunning) return steps[currentStep].label + "…"
|
||||
@@ -3998,8 +4051,10 @@ ShellRoot {
|
||||
|
||||
Rectangle {
|
||||
visible: !started
|
||||
width: 80; height: 28
|
||||
radius: 14
|
||||
width: 80
|
||||
height: 28
|
||||
radius: 14
|
||||
opacity: sudoPassword === "" ? 0.4 : 1.0
|
||||
gradient: Gradient {
|
||||
orientation: Gradient.Horizontal
|
||||
GradientStop { position: 0.0; color: colors.blue }
|
||||
@@ -4014,19 +4069,22 @@ ShellRoot {
|
||||
}
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
cursorShape: sudoPassword === "" ? Qt.ArrowCursor : Qt.PointingHandCursor
|
||||
onClicked: {
|
||||
started = true
|
||||
runStep(0)
|
||||
if (sudoPassword !== "") {
|
||||
started = true
|
||||
runStep(0)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
visible: !isRunning && started
|
||||
width: 80; height: 28
|
||||
radius: 14
|
||||
color: colors.surface1
|
||||
width: 80
|
||||
height: 28
|
||||
radius: 14
|
||||
color: colors.surface1
|
||||
Text {
|
||||
anchors.centerIn: parent
|
||||
text: currentStep === steps.length ? "Close" : "Dismiss"
|
||||
|
||||
@@ -23,15 +23,18 @@ ShellRoot {
|
||||
property bool isFailed: false
|
||||
property string currentLog: ""
|
||||
property bool started: false
|
||||
property string sudoPassword: ""
|
||||
|
||||
readonly property int rebuildStep: 5
|
||||
|
||||
readonly property var steps: [
|
||||
{ label: "Updating flake.lock", cmd: ["nix", "flake", "update"], cwd: "/home/henrov/Repos/nixos/Droidnix" },
|
||||
{ label: "Updating Flatpaks", cmd: ["flatpak", "update", "-y"], cwd: "/home/henrov" },
|
||||
{ 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: "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: "Reloading Hyprland", cmd: ["hyprctl", "reload"], cwd: "/home/henrov" },
|
||||
{ label: "Updating flake.lock", cmd: ["nix", "flake", "update"], cwd: "/home/henrov/Repos/nixos/Droidnix" },
|
||||
{ label: "Updating Flatpaks", cmd: ["flatpak", "update", "-y"], cwd: "/home/henrov" },
|
||||
{ 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: "Pushing to remote", cmd: ["git", "push"], 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" },
|
||||
]
|
||||
|
||||
function runStep(index) {
|
||||
@@ -64,6 +67,13 @@ ShellRoot {
|
||||
}
|
||||
}
|
||||
|
||||
onStarted: {
|
||||
if (currentStep === rebuildStep) {
|
||||
stdin.write(sudoPassword + "\n")
|
||||
stdin.close()
|
||||
}
|
||||
}
|
||||
|
||||
onExited: (code) => {
|
||||
if (code !== 0 && currentStep !== 3) {
|
||||
isFailed = true
|
||||
@@ -77,8 +87,8 @@ ShellRoot {
|
||||
FloatingWindow {
|
||||
title: "quickshell-updater"
|
||||
visible: true
|
||||
width: 540
|
||||
height: contentCol.implicitHeight + 32
|
||||
width: 640
|
||||
height: contentCol.implicitHeight + 48
|
||||
color: "transparent"
|
||||
|
||||
Shortcut {
|
||||
@@ -111,7 +121,7 @@ ShellRoot {
|
||||
right: parent.right
|
||||
margins: 20
|
||||
}
|
||||
spacing: 8
|
||||
spacing: 12
|
||||
|
||||
Text {
|
||||
text: " System Update"
|
||||
@@ -134,14 +144,12 @@ ShellRoot {
|
||||
readonly property bool failed: isFailed && index === currentStep
|
||||
readonly property bool pending: !done && !active && !failed
|
||||
|
||||
// icon
|
||||
Text {
|
||||
font.pixelSize: 14
|
||||
text: failed ? "✗" : done ? "✓" : active ? "›" : "○"
|
||||
color: failed ? colors.red : done ? colors.green : active ? colors.yellow : colors.surface1
|
||||
}
|
||||
|
||||
// label
|
||||
Text {
|
||||
text: steps[index].label
|
||||
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
|
||||
Rectangle {
|
||||
Layout.fillWidth: true
|
||||
height: 160
|
||||
height: 220
|
||||
radius: 8
|
||||
color: colors.surface0
|
||||
visible: currentLog !== "" && started
|
||||
@@ -180,7 +233,7 @@ ShellRoot {
|
||||
Text {
|
||||
font.pixelSize: 12
|
||||
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 (currentStep === steps.length) return "✓ All done!"
|
||||
if (isRunning) return steps[currentStep].label + "…"
|
||||
@@ -193,8 +246,10 @@ ShellRoot {
|
||||
|
||||
Rectangle {
|
||||
visible: !started
|
||||
width: 80; height: 28
|
||||
radius: 14
|
||||
width: 80
|
||||
height: 28
|
||||
radius: 14
|
||||
opacity: sudoPassword === "" ? 0.4 : 1.0
|
||||
gradient: Gradient {
|
||||
orientation: Gradient.Horizontal
|
||||
GradientStop { position: 0.0; color: colors.blue }
|
||||
@@ -209,19 +264,22 @@ ShellRoot {
|
||||
}
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
cursorShape: sudoPassword === "" ? Qt.ArrowCursor : Qt.PointingHandCursor
|
||||
onClicked: {
|
||||
started = true
|
||||
runStep(0)
|
||||
if (sudoPassword !== "") {
|
||||
started = true
|
||||
runStep(0)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
visible: !isRunning && started
|
||||
width: 80; height: 28
|
||||
radius: 14
|
||||
color: colors.surface1
|
||||
width: 80
|
||||
height: 28
|
||||
radius: 14
|
||||
color: colors.surface1
|
||||
Text {
|
||||
anchors.centerIn: parent
|
||||
text: currentStep === steps.length ? "Close" : "Dismiss"
|
||||
|
||||
Reference in New Issue
Block a user