Regenerated
This commit is contained in:
+441
-498
File diff suppressed because it is too large
Load Diff
+48
-105
@@ -3670,92 +3670,53 @@ 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
|
||||||
import Quickshell
|
|
||||||
import Quickshell.Io
|
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Layouts
|
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
|
|
||||||
Window {
|
Window {
|
||||||
id: root
|
width: 500
|
||||||
width: 600
|
height: 200
|
||||||
height: 380
|
|
||||||
visible: true
|
visible: true
|
||||||
|
title: "System Updater"
|
||||||
|
|
||||||
property int currentStep: 0
|
property int progress: 0
|
||||||
property int totalSteps: 4
|
property string status: "Waiting..."
|
||||||
property string status: "idle"
|
|
||||||
|
Timer {
|
||||||
|
interval: 300
|
||||||
|
running: true
|
||||||
|
repeat: true
|
||||||
|
|
||||||
|
onTriggered: {
|
||||||
|
let file = "/tmp/nixos-updater-status"
|
||||||
|
|
||||||
|
let xhr = new XMLHttpRequest()
|
||||||
|
xhr.open("GET", "file://" + file)
|
||||||
|
xhr.onreadystatechange = function() {
|
||||||
|
if (xhr.readyState === XMLHttpRequest.DONE) {
|
||||||
|
let parts = xhr.responseText.trim().split("|")
|
||||||
|
|
||||||
|
if (parts.length === 2) {
|
||||||
|
progress = parseInt(parts[0])
|
||||||
|
status = parts[1]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
xhr.send()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
anchors.fill: parent
|
anchors.centerIn: parent
|
||||||
anchors.margins: 16
|
|
||||||
spacing: 10
|
spacing: 10
|
||||||
|
|
||||||
Text {
|
Text { text: status }
|
||||||
text: "System Updater"
|
|
||||||
font.pixelSize: 20
|
|
||||||
}
|
|
||||||
|
|
||||||
ProgressBar {
|
ProgressBar {
|
||||||
from: 0
|
from: 0
|
||||||
to: root.totalSteps
|
to: 100
|
||||||
value: root.currentStep
|
value: progress
|
||||||
width: parent.width
|
width: 300
|
||||||
}
|
|
||||||
|
|
||||||
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"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4084,46 +4045,28 @@ main
|
|||||||
** =generated/.config/scripts/update-engine.sh=
|
** =generated/.config/scripts/update-engine.sh=
|
||||||
A file containing color variables
|
A file containing color variables
|
||||||
#+BEGIN_SRC sh :tangle generated/.config/scripts/update-engine.sh :shebang "#!/usr/bin/env bash" :noweb yes :mkdirp yes :eval never
|
#+BEGIN_SRC sh :tangle generated/.config/scripts/update-engine.sh :shebang "#!/usr/bin/env bash" :noweb yes :mkdirp yes :eval never
|
||||||
set -uo pipefail
|
|
||||||
|
|
||||||
emit() { echo "$1"; }
|
STATUS_FILE="/tmp/nixos-updater-status"
|
||||||
|
|
||||||
step() {
|
echo "0|Starting" > "$STATUS_FILE"
|
||||||
echo "STEP:$1:$2"
|
|
||||||
|
update_step() {
|
||||||
|
echo "$1|$2" > "$STATUS_FILE"
|
||||||
}
|
}
|
||||||
|
|
||||||
ok() {
|
update_step 10 "Fixing ownership"
|
||||||
echo "OK:$1"
|
sudo chown -R "$USER":"wheel" "$REPO"
|
||||||
}
|
|
||||||
|
|
||||||
fail() {
|
update_step 30 "Updating flake"
|
||||||
echo "FAIL:$1"
|
nix flake update
|
||||||
}
|
|
||||||
|
|
||||||
REPO="/home/$USER/Repos/nixos/Droidnix"
|
update_step 60 "Rebuilding system"
|
||||||
HOSTNAME="$(hostname)"
|
sudo nixos-rebuild switch --flake ".#$HOSTNAME"
|
||||||
cd "$REPO" || exit 1
|
|
||||||
|
|
||||||
step 1 "Fixing ownership"
|
update_step 90 "Updating Flatpaks"
|
||||||
sudo chown -R "$USER":"wheel" "$REPO" || fail "ownership"
|
flatpak update -y
|
||||||
ok 1
|
|
||||||
|
|
||||||
step 2 "Updating flake"
|
update_step 100 "Done"
|
||||||
nix flake update || fail "flake"
|
|
||||||
ok 2
|
|
||||||
|
|
||||||
step 3 "Rebuilding system"
|
|
||||||
sudo nixos-rebuild switch --flake ".#$HOSTNAME" || fail "rebuild"
|
|
||||||
hyprctl reload
|
|
||||||
ok 3
|
|
||||||
|
|
||||||
step 4 "Flatpak cleanup"
|
|
||||||
flatpak uninstall --unused -y
|
|
||||||
flatpak update --appstream -y
|
|
||||||
flatpak update -y || fail "flatpak"
|
|
||||||
ok 4
|
|
||||||
|
|
||||||
emit "DONE"
|
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
** =generated/.config/wofi/scripts/wofi-launcher.sh=
|
** =generated/.config/wofi/scripts/wofi-launcher.sh=
|
||||||
|
|||||||
@@ -1,90 +1,51 @@
|
|||||||
// --- 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.Io
|
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Layouts
|
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
|
|
||||||
Window {
|
Window {
|
||||||
id: root
|
width: 500
|
||||||
width: 600
|
height: 200
|
||||||
height: 380
|
|
||||||
visible: true
|
visible: true
|
||||||
|
title: "System Updater"
|
||||||
|
|
||||||
property int currentStep: 0
|
property int progress: 0
|
||||||
property int totalSteps: 4
|
property string status: "Waiting..."
|
||||||
property string status: "idle"
|
|
||||||
|
Timer {
|
||||||
|
interval: 300
|
||||||
|
running: true
|
||||||
|
repeat: true
|
||||||
|
|
||||||
|
onTriggered: {
|
||||||
|
let file = "/tmp/nixos-updater-status"
|
||||||
|
|
||||||
|
let xhr = new XMLHttpRequest()
|
||||||
|
xhr.open("GET", "file://" + file)
|
||||||
|
xhr.onreadystatechange = function() {
|
||||||
|
if (xhr.readyState === XMLHttpRequest.DONE) {
|
||||||
|
let parts = xhr.responseText.trim().split("|")
|
||||||
|
|
||||||
|
if (parts.length === 2) {
|
||||||
|
progress = parseInt(parts[0])
|
||||||
|
status = parts[1]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
xhr.send()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
anchors.fill: parent
|
anchors.centerIn: parent
|
||||||
anchors.margins: 16
|
|
||||||
spacing: 10
|
spacing: 10
|
||||||
|
|
||||||
Text {
|
Text { text: status }
|
||||||
text: "System Updater"
|
|
||||||
font.pixelSize: 20
|
|
||||||
}
|
|
||||||
|
|
||||||
ProgressBar {
|
ProgressBar {
|
||||||
from: 0
|
from: 0
|
||||||
to: root.totalSteps
|
to: 100
|
||||||
value: root.currentStep
|
value: progress
|
||||||
width: parent.width
|
width: 300
|
||||||
}
|
|
||||||
|
|
||||||
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"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,42 +1,24 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# --- 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. ---
|
||||||
set -uo pipefail
|
|
||||||
|
|
||||||
emit() { echo "$1"; }
|
STATUS_FILE="/tmp/nixos-updater-status"
|
||||||
|
|
||||||
step() {
|
echo "0|Starting" > "$STATUS_FILE"
|
||||||
echo "STEP:$1:$2"
|
|
||||||
|
update_step() {
|
||||||
|
echo "$1|$2" > "$STATUS_FILE"
|
||||||
}
|
}
|
||||||
|
|
||||||
ok() {
|
update_step 10 "Fixing ownership"
|
||||||
echo "OK:$1"
|
sudo chown -R "$USER":"wheel" "$REPO"
|
||||||
}
|
|
||||||
|
|
||||||
fail() {
|
update_step 30 "Updating flake"
|
||||||
echo "FAIL:$1"
|
nix flake update
|
||||||
}
|
|
||||||
|
|
||||||
REPO="/home/$USER/Repos/nixos/Droidnix"
|
update_step 60 "Rebuilding system"
|
||||||
HOSTNAME="$(hostname)"
|
sudo nixos-rebuild switch --flake ".#$HOSTNAME"
|
||||||
cd "$REPO" || exit 1
|
|
||||||
|
|
||||||
step 1 "Fixing ownership"
|
update_step 90 "Updating Flatpaks"
|
||||||
sudo chown -R "$USER":"wheel" "$REPO" || fail "ownership"
|
flatpak update -y
|
||||||
ok 1
|
|
||||||
|
|
||||||
step 2 "Updating flake"
|
update_step 100 "Done"
|
||||||
nix flake update || fail "flake"
|
|
||||||
ok 2
|
|
||||||
|
|
||||||
step 3 "Rebuilding system"
|
|
||||||
sudo nixos-rebuild switch --flake ".#$HOSTNAME" || fail "rebuild"
|
|
||||||
hyprctl reload
|
|
||||||
ok 3
|
|
||||||
|
|
||||||
step 4 "Flatpak cleanup"
|
|
||||||
flatpak uninstall --unused -y
|
|
||||||
flatpak update --appstream -y
|
|
||||||
flatpak update -y || fail "flatpak"
|
|
||||||
ok 4
|
|
||||||
|
|
||||||
emit "DONE"
|
|
||||||
|
|||||||
Reference in New Issue
Block a user