Regenerated

This commit is contained in:
2026-04-29 13:01:06 +02:00
parent 2ba973cdb3
commit a32a776778
4 changed files with 680 additions and 752 deletions
+486 -510
View File
File diff suppressed because it is too large Load Diff
+97 -121
View File
@@ -3081,6 +3081,16 @@ windowrule {
pin = on pin = on
} }
#Quickshell updater
windowrule {
name = quickshell-updater
match:title = quickshell-updater
opacity = 1.0 0.8
float = on
move = cursor -50% 0
pin = on
}
#Quickshell layoutswitcher #Quickshell layoutswitcher
windowrule { windowrule {
name = quickshell-layoutswitcher name = quickshell-layoutswitcher
@@ -3666,7 +3676,6 @@ ShellRoot {
** =generated/.config/quickshell/updater/shell.qml= ** =generated/.config/quickshell/updater/shell.qml=
Updates the system Updates the system
#+BEGIN_SRC qml :tangle generated/.config/quickshell/updater/shell.qml :noweb yes :mkdirp yes :eval never #+BEGIN_SRC qml :tangle generated/.config/quickshell/updater/shell.qml :noweb yes :mkdirp yes :eval never
// --- This file has been auto-generated. For permanent changes alter the appropriate block in the README.org. ---
import Quickshell import Quickshell
import Quickshell.Io import Quickshell.Io
import QtQuick import QtQuick
@@ -3684,38 +3693,35 @@ ShellRoot {
readonly property color blue: "#89b4fa" readonly property color blue: "#89b4fa"
readonly property color red: "#f38ba8" readonly property color red: "#f38ba8"
readonly property color yellow: "#f9e2af" readonly property color yellow: "#f9e2af"
readonly property color peach: "#fab387"
} }
QtObject { property int currentStep: 0
id: state property bool isRunning: false
property int step: 0 property bool isFailed: false
property bool running: false property string currentLog: ""
property bool failed: false property bool started: false
property string log: ""
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" },
{ label: "Updating Flatpaks", cmd: ["flatpak", "update", "-y"], cwd: "/home/henrov" }, { label: "Updating Flatpaks", cmd: ["flatpak", "update", "-y"], cwd: "/home/henrov" },
{ 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: ["sudo", "nixos-rebuild", "switch", "--flake", ".#traveldroid"], cwd: "/home/henrov/Repos/nixos/Droidnix" }, { label: "Rebuilding NixOS", cmd: ["sudo", "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" },
] ]
}
function runStep(index) { function runStep(index) {
if (index >= state.steps.length) { if (index >= steps.length) {
state.running = false isRunning = false
state.step = state.steps.length currentStep = steps.length
return return
} }
state.step = index currentStep = index
state.log = "" // clear log for each new step currentLog = ""
state.running = true isRunning = true
stepProc.command = state.steps[index].cmd stepProc.command = steps[index].cmd
stepProc.workingDirectory = state.steps[index].cwd stepProc.workingDirectory = steps[index].cwd
stepProc.running = true stepProc.running = true
} }
@@ -3724,32 +3730,31 @@ ShellRoot {
stdout: SplitParser { stdout: SplitParser {
onRead: (line) => { onRead: (line) => {
state.log = (state.log + "\n" + line).split("\n").slice(-8).join("\n").trim() currentLog = (currentLog + "\n" + line).split("\n").slice(-8).join("\n").trim()
} }
} }
stderr: SplitParser { stderr: SplitParser {
onRead: (line) => { onRead: (line) => {
if (line.trim() !== "") if (line.trim() !== "")
state.log = (state.log + "\n" + line).split("\n").slice(-8).join("\n").trim() currentLog = (currentLog + "\n" + line).split("\n").slice(-8).join("\n").trim()
} }
} }
onExited: (code) => { onExited: (code) => {
if (code !== 0 && state.step !== 3) { if (code !== 0 && currentStep !== 3) {
state.failed = true isFailed = true
state.running = false isRunning = false
} else { } else {
runStep(state.step + 1) runStep(currentStep + 1)
} }
} }
} }
FloatingWindow { FloatingWindow {
id: root
title: "quickshell-updater" title: "quickshell-updater"
visible: true visible: true
width: 520 width: 540
height: contentCol.implicitHeight + 32 height: contentCol.implicitHeight + 32
color: "transparent" color: "transparent"
@@ -3758,7 +3763,6 @@ ShellRoot {
onActivated: Qt.quit() onActivated: Qt.quit()
} }
// Gradient border
Rectangle { Rectangle {
anchors.fill: parent anchors.fill: parent
anchors.margins: -2 anchors.margins: -2
@@ -3784,119 +3788,89 @@ ShellRoot {
right: parent.right right: parent.right
margins: 20 margins: 20
} }
spacing: 12 spacing: 8
// Title
Text { Text {
text: " System Update" text: " System Update"
color: colors.text color: colors.text
font.pixelSize: 15 font.pixelSize: 15
font.bold: true font.bold: true
Layout.topMargin: 4 Layout.topMargin: 8
} }
// Steps list // Steps
Repeater { Repeater {
model: state.steps.length model: steps.length
delegate: RowLayout { delegate: RowLayout {
spacing: 10 spacing: 10
Layout.fillWidth: true Layout.fillWidth: true
// Icon readonly property bool done: !isFailed && (index < currentStep || (!isRunning && currentStep === steps.length))
readonly property bool active: isRunning && index === currentStep
readonly property bool failed: isFailed && index === currentStep
readonly property bool pending: !done && !active && !failed
// icon
Text { Text {
font.pixelSize: 14 font.pixelSize: 14
text: { text: failed ? "✗" : done ? "✓" : active ? "" : "○"
if (state.failed && index === state.step) return "✗" color: failed ? colors.red : done ? colors.green : active ? colors.yellow : colors.surface1
if (index < state.step || (!state.running && index === state.step)) return "✓"
if (index === state.step && state.running) return "…"
return "○"
}
color: {
if (state.failed && index === state.step) return colors.red
if (index < state.step || (!state.running && !state.failed && index === state.step)) return colors.green
if (index === state.step && state.running) return colors.yellow
return colors.surface1
}
} }
// label
Text { Text {
text: state.steps[index].label text: steps[index].label
font.pixelSize: 13 font.pixelSize: 13
color: { color: failed ? colors.red : done ? colors.green : active ? colors.text : colors.surface1
if (state.failed && index === state.step) return colors.red
if (index < state.step) return colors.subtext0
if (index === state.step) return colors.text
return colors.surface1
}
}
// Spinner for active step
Text {
visible: index === state.step && state.running
text: "⠋"
color: colors.blue
font.pixelSize: 13
RotationAnimation on rotation {
running: index === state.step && state.running
from: 0; to: 360
duration: 1000
loops: Animation.Infinite
}
} }
} }
} }
// Log output // Log box
Rectangle { Rectangle {
Layout.fillWidth: true Layout.fillWidth: true
height: 160 height: 160
radius: 8 radius: 8
color: colors.surface0 color: colors.surface0
visible: state.log !== "" visible: currentLog !== "" && started
Text { Text {
anchors { anchors {
fill: parent fill: parent
margins: 8 margins: 10
} }
text: state.log text: currentLog
color: colors.subtext0 color: colors.subtext0
font.pixelSize: 11 font.pixelSize: 11
font.family: "monospace" font.family: "monospace"
wrapMode: Text.WrapAnywhere wrapMode: Text.WrapAnywhere
elide: Text.ElideLeft
verticalAlignment: Text.AlignBottom verticalAlignment: Text.AlignBottom
} }
} }
// Status / close // Bottom bar
RowLayout { RowLayout {
Layout.fillWidth: true Layout.fillWidth: true
Layout.bottomMargin: 4 Layout.bottomMargin: 8
Text { Text {
text: {
if (state.failed) return "✗ Failed at: " + state.steps[state.step].label
if (state.step === state.steps.length) return "✓ Done!"
if (state.running) return "Running…"
return "Press Start"
}
color: {
if (state.failed) return colors.red
if (state.step === state.steps.length) return colors.green
return colors.subtext0
}
font.pixelSize: 12 font.pixelSize: 12
text: {
if (!started) return "Press Start to begin"
if (isFailed) return "✗ Failed at: " + steps[currentStep].label
if (currentStep === steps.length) return "✓ All done!"
if (isRunning) return steps[currentStep].label + "…"
return ""
}
color: isFailed ? colors.red : currentStep === steps.length ? colors.green : colors.subtext0
} }
Item { Layout.fillWidth: true } Item { Layout.fillWidth: true }
// Start button
Rectangle { Rectangle {
visible: !state.running && state.step === 0 visible: !started
width: 80; height: 28 width: 80; height: 28
radius: 14 radius: 14
gradient: Gradient { gradient: Gradient {
orientation: Gradient.Horizontal orientation: Gradient.Horizontal
@@ -3905,29 +3879,31 @@ ShellRoot {
} }
Text { Text {
anchors.centerIn: parent anchors.centerIn: parent
text: "Start" text: "Start"
color: colors.base color: colors.base
font.pixelSize: 12 font.pixelSize: 12
font.bold: true font.bold: true
} }
MouseArea { MouseArea {
anchors.fill: parent anchors.fill: parent
cursorShape: Qt.PointingHandCursor cursorShape: Qt.PointingHandCursor
onClicked: runStep(0) onClicked: {
started = true
runStep(0)
}
} }
} }
// Close button
Rectangle { Rectangle {
visible: !state.running && state.step > 0 visible: !isRunning && started
width: 80; height: 28 width: 80; height: 28
radius: 14 radius: 14
color: colors.surface1 color: colors.surface1
Text { Text {
anchors.centerIn: parent anchors.centerIn: parent
text: "Close" text: currentStep === steps.length ? "Close" : "Dismiss"
color: colors.text color: colors.text
font.pixelSize: 12 font.pixelSize: 12
} }
MouseArea { MouseArea {
anchors.fill: parent anchors.fill: parent
@@ -46,6 +46,16 @@ windowrule {
pin = on pin = on
} }
#Quickshell updater
windowrule {
name = quickshell-updater
match:title = quickshell-updater
opacity = 1.0 0.8
float = on
move = cursor -50% 0
pin = on
}
#Quickshell layoutswitcher #Quickshell layoutswitcher
windowrule { windowrule {
name = quickshell-layoutswitcher name = quickshell-layoutswitcher
@@ -1,5 +1,4 @@
// --- This file has been auto-generated. For permanent changes alter the appropriate block in the README.org. --- // --- This file has been auto-generated. For permanent changes alter the appropriate block in the README.org. ---
// --- This file has been auto-generated. For permanent changes alter the appropriate block in the README.org. ---
import Quickshell import Quickshell
import Quickshell.Io import Quickshell.Io
import QtQuick import QtQuick
@@ -17,38 +16,35 @@ ShellRoot {
readonly property color blue: "#89b4fa" readonly property color blue: "#89b4fa"
readonly property color red: "#f38ba8" readonly property color red: "#f38ba8"
readonly property color yellow: "#f9e2af" readonly property color yellow: "#f9e2af"
readonly property color peach: "#fab387"
} }
QtObject { property int currentStep: 0
id: state property bool isRunning: false
property int step: 0 property bool isFailed: false
property bool running: false property string currentLog: ""
property bool failed: false property bool started: false
property string log: ""
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" },
{ label: "Updating Flatpaks", cmd: ["flatpak", "update", "-y"], cwd: "/home/henrov" }, { label: "Updating Flatpaks", cmd: ["flatpak", "update", "-y"], cwd: "/home/henrov" },
{ 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: ["sudo", "nixos-rebuild", "switch", "--flake", ".#traveldroid"], cwd: "/home/henrov/Repos/nixos/Droidnix" }, { label: "Rebuilding NixOS", cmd: ["sudo", "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" },
] ]
}
function runStep(index) { function runStep(index) {
if (index >= state.steps.length) { if (index >= steps.length) {
state.running = false isRunning = false
state.step = state.steps.length currentStep = steps.length
return return
} }
state.step = index currentStep = index
state.log = "" // clear log for each new step currentLog = ""
state.running = true isRunning = true
stepProc.command = state.steps[index].cmd stepProc.command = steps[index].cmd
stepProc.workingDirectory = state.steps[index].cwd stepProc.workingDirectory = steps[index].cwd
stepProc.running = true stepProc.running = true
} }
@@ -57,32 +53,31 @@ ShellRoot {
stdout: SplitParser { stdout: SplitParser {
onRead: (line) => { onRead: (line) => {
state.log = (state.log + "\n" + line).split("\n").slice(-8).join("\n").trim() currentLog = (currentLog + "\n" + line).split("\n").slice(-8).join("\n").trim()
} }
} }
stderr: SplitParser { stderr: SplitParser {
onRead: (line) => { onRead: (line) => {
if (line.trim() !== "") if (line.trim() !== "")
state.log = (state.log + "\n" + line).split("\n").slice(-8).join("\n").trim() currentLog = (currentLog + "\n" + line).split("\n").slice(-8).join("\n").trim()
} }
} }
onExited: (code) => { onExited: (code) => {
if (code !== 0 && state.step !== 3) { if (code !== 0 && currentStep !== 3) {
state.failed = true isFailed = true
state.running = false isRunning = false
} else { } else {
runStep(state.step + 1) runStep(currentStep + 1)
} }
} }
} }
FloatingWindow { FloatingWindow {
id: root
title: "quickshell-updater" title: "quickshell-updater"
visible: true visible: true
width: 520 width: 540
height: contentCol.implicitHeight + 32 height: contentCol.implicitHeight + 32
color: "transparent" color: "transparent"
@@ -91,7 +86,6 @@ ShellRoot {
onActivated: Qt.quit() onActivated: Qt.quit()
} }
// Gradient border
Rectangle { Rectangle {
anchors.fill: parent anchors.fill: parent
anchors.margins: -2 anchors.margins: -2
@@ -117,119 +111,89 @@ ShellRoot {
right: parent.right right: parent.right
margins: 20 margins: 20
} }
spacing: 12 spacing: 8
// Title
Text { Text {
text: " System Update" text: " System Update"
color: colors.text color: colors.text
font.pixelSize: 15 font.pixelSize: 15
font.bold: true font.bold: true
Layout.topMargin: 4 Layout.topMargin: 8
} }
// Steps list // Steps
Repeater { Repeater {
model: state.steps.length model: steps.length
delegate: RowLayout { delegate: RowLayout {
spacing: 10 spacing: 10
Layout.fillWidth: true Layout.fillWidth: true
// Icon readonly property bool done: !isFailed && (index < currentStep || (!isRunning && currentStep === steps.length))
readonly property bool active: isRunning && index === currentStep
readonly property bool failed: isFailed && index === currentStep
readonly property bool pending: !done && !active && !failed
// icon
Text { Text {
font.pixelSize: 14 font.pixelSize: 14
text: { text: failed ? "✗" : done ? "✓" : active ? "" : "○"
if (state.failed && index === state.step) return "✗" color: failed ? colors.red : done ? colors.green : active ? colors.yellow : colors.surface1
if (index < state.step || (!state.running && index === state.step)) return "✓"
if (index === state.step && state.running) return "…"
return "○"
}
color: {
if (state.failed && index === state.step) return colors.red
if (index < state.step || (!state.running && !state.failed && index === state.step)) return colors.green
if (index === state.step && state.running) return colors.yellow
return colors.surface1
}
} }
// label
Text { Text {
text: state.steps[index].label text: steps[index].label
font.pixelSize: 13 font.pixelSize: 13
color: { color: failed ? colors.red : done ? colors.green : active ? colors.text : colors.surface1
if (state.failed && index === state.step) return colors.red
if (index < state.step) return colors.subtext0
if (index === state.step) return colors.text
return colors.surface1
}
}
// Spinner for active step
Text {
visible: index === state.step && state.running
text: "⠋"
color: colors.blue
font.pixelSize: 13
RotationAnimation on rotation {
running: index === state.step && state.running
from: 0; to: 360
duration: 1000
loops: Animation.Infinite
}
} }
} }
} }
// Log output // Log box
Rectangle { Rectangle {
Layout.fillWidth: true Layout.fillWidth: true
height: 160 height: 160
radius: 8 radius: 8
color: colors.surface0 color: colors.surface0
visible: state.log !== "" visible: currentLog !== "" && started
Text { Text {
anchors { anchors {
fill: parent fill: parent
margins: 8 margins: 10
} }
text: state.log text: currentLog
color: colors.subtext0 color: colors.subtext0
font.pixelSize: 11 font.pixelSize: 11
font.family: "monospace" font.family: "monospace"
wrapMode: Text.WrapAnywhere wrapMode: Text.WrapAnywhere
elide: Text.ElideLeft
verticalAlignment: Text.AlignBottom verticalAlignment: Text.AlignBottom
} }
} }
// Status / close // Bottom bar
RowLayout { RowLayout {
Layout.fillWidth: true Layout.fillWidth: true
Layout.bottomMargin: 4 Layout.bottomMargin: 8
Text { Text {
text: {
if (state.failed) return "✗ Failed at: " + state.steps[state.step].label
if (state.step === state.steps.length) return "✓ Done!"
if (state.running) return "Running…"
return "Press Start"
}
color: {
if (state.failed) return colors.red
if (state.step === state.steps.length) return colors.green
return colors.subtext0
}
font.pixelSize: 12 font.pixelSize: 12
text: {
if (!started) return "Press Start to begin"
if (isFailed) return "✗ Failed at: " + steps[currentStep].label
if (currentStep === steps.length) return "✓ All done!"
if (isRunning) return steps[currentStep].label + "…"
return ""
}
color: isFailed ? colors.red : currentStep === steps.length ? colors.green : colors.subtext0
} }
Item { Layout.fillWidth: true } Item { Layout.fillWidth: true }
// Start button
Rectangle { Rectangle {
visible: !state.running && state.step === 0 visible: !started
width: 80; height: 28 width: 80; height: 28
radius: 14 radius: 14
gradient: Gradient { gradient: Gradient {
orientation: Gradient.Horizontal orientation: Gradient.Horizontal
@@ -238,29 +202,31 @@ ShellRoot {
} }
Text { Text {
anchors.centerIn: parent anchors.centerIn: parent
text: "Start" text: "Start"
color: colors.base color: colors.base
font.pixelSize: 12 font.pixelSize: 12
font.bold: true font.bold: true
} }
MouseArea { MouseArea {
anchors.fill: parent anchors.fill: parent
cursorShape: Qt.PointingHandCursor cursorShape: Qt.PointingHandCursor
onClicked: runStep(0) onClicked: {
started = true
runStep(0)
}
} }
} }
// Close button
Rectangle { Rectangle {
visible: !state.running && state.step > 0 visible: !isRunning && started
width: 80; height: 28 width: 80; height: 28
radius: 14 radius: 14
color: colors.surface1 color: colors.surface1
Text { Text {
anchors.centerIn: parent anchors.centerIn: parent
text: "Close" text: currentStep === steps.length ? "Close" : "Dismiss"
color: colors.text color: colors.text
font.pixelSize: 12 font.pixelSize: 12
} }
MouseArea { MouseArea {
anchors.fill: parent anchors.fill: parent