Regenerated
This commit is contained in:
+523
-403
File diff suppressed because it is too large
Load Diff
+129
-16
@@ -2857,7 +2857,8 @@ bind = , workspace, exec, ~/.config/scripts/set-workspace-wallpaper.sh
|
|||||||
#########################
|
#########################
|
||||||
# System stuff
|
# System stuff
|
||||||
#########################
|
#########################
|
||||||
bind = $mainMod, U, exec, kitty --class update-term -e bash -lc "~/.config/scripts/update.sh; exec bash"
|
# bind = $mainMod, U, exec, kitty --class update-term -e bash -lc "~/.config/scripts/update.sh; exec bash"
|
||||||
|
bind = $mainMod, U, exec, qs -c updater
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
** =generated/.config/hypr/exec-once.conf=
|
** =generated/.config/hypr/exec-once.conf=
|
||||||
@@ -3666,6 +3667,98 @@ ShellRoot {
|
|||||||
}
|
}
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
|
** =generated/.config/quickshell/updater/shell.qml=
|
||||||
|
Updates the system
|
||||||
|
#+BEGIN_SRC qml :tangle generated/.config/quickshell/updater/shell.qml :noweb yes :mkdirp yes :eval never
|
||||||
|
import Quickshell
|
||||||
|
|
||||||
|
ShellWindow {
|
||||||
|
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"]
|
||||||
|
|
||||||
|
onStdout: function(data) {
|
||||||
|
let line = data.trim()
|
||||||
|
|
||||||
|
logModel.append({ text: line })
|
||||||
|
|
||||||
|
if (line.startsWith("STEP:")) {
|
||||||
|
let parts = line.split(":")
|
||||||
|
root.currentStep = parseInt(parts[1])
|
||||||
|
}
|
||||||
|
|
||||||
|
if (line.startsWith("DONE")) {
|
||||||
|
root.status = "done"
|
||||||
|
}
|
||||||
|
|
||||||
|
if (line.startsWith("FAIL")) {
|
||||||
|
root.status = "error"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
** =generated/.config/quickshell/layoutswitcher/shell.qml=
|
** =generated/.config/quickshell/layoutswitcher/shell.qml=
|
||||||
Provides a layout menu
|
Provides a layout menu
|
||||||
#+BEGIN_SRC qml :tangle generated/.config/quickshell/layoutswitcher/shell.qml :noweb yes :mkdirp yes :eval never
|
#+BEGIN_SRC qml :tangle generated/.config/quickshell/layoutswitcher/shell.qml :noweb yes :mkdirp yes :eval never
|
||||||
@@ -3986,29 +4079,49 @@ main() {
|
|||||||
main
|
main
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
** =generated/.config/scripts/update.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.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
|
set -uo pipefail
|
||||||
|
|
||||||
|
emit() { echo "$1"; }
|
||||||
|
|
||||||
|
step() {
|
||||||
|
echo "STEP:$1:$2"
|
||||||
|
}
|
||||||
|
|
||||||
|
ok() {
|
||||||
|
echo "OK:$1"
|
||||||
|
}
|
||||||
|
|
||||||
|
fail() {
|
||||||
|
echo "FAIL:$1"
|
||||||
|
}
|
||||||
|
|
||||||
REPO="/home/$USER/Repos/nixos/Droidnix"
|
REPO="/home/$USER/Repos/nixos/Droidnix"
|
||||||
HOSTNAME="$(hostname)"
|
HOSTNAME="$(hostname)"
|
||||||
cd "$REPO"
|
cd "$REPO" || exit 1
|
||||||
|
|
||||||
run() {
|
step 1 "Fixing ownership"
|
||||||
echo
|
sudo chown -R "$USER":"wheel" "$REPO" || fail "ownership"
|
||||||
echo "▶ $1"
|
ok 1
|
||||||
shift
|
|
||||||
"$@" || { echo "❌ Failed: $1"; exit 1; }
|
|
||||||
}
|
|
||||||
|
|
||||||
run "Fixing ownership" sudo chown -R "$USER":"wheel" "$REPO"
|
step 2 "Updating flake"
|
||||||
run "Updating flake" nix flake update
|
nix flake update || fail "flake"
|
||||||
run "Rebuilding NixOS" sudo nixos-rebuild switch --flake ".#$HOSTNAME" && hyprctl reload
|
ok 2
|
||||||
run "Updating Flatpaks" flatpak uninstall --unused && flatpak update --appstream && flatpak update -y
|
|
||||||
|
|
||||||
echo
|
step 3 "Rebuilding system"
|
||||||
echo "✅ Done"
|
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=
|
||||||
|
|||||||
@@ -165,4 +165,5 @@ bind = , workspace, exec, ~/.config/scripts/set-workspace-wallpaper.sh
|
|||||||
#########################
|
#########################
|
||||||
# System stuff
|
# System stuff
|
||||||
#########################
|
#########################
|
||||||
bind = $mainMod, U, exec, kitty --class update-term -e bash -lc "~/.config/scripts/update.sh; exec bash"
|
# bind = $mainMod, U, exec, kitty --class update-term -e bash -lc "~/.config/scripts/update.sh; exec bash"
|
||||||
|
bind = $mainMod, U, exec, qs -c updater
|
||||||
|
|||||||
@@ -0,0 +1,88 @@
|
|||||||
|
// --- This file has been auto-generated. For permanent changes alter the appropriate block in the README.org. ---
|
||||||
|
import Quickshell
|
||||||
|
|
||||||
|
ShellWindow {
|
||||||
|
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"]
|
||||||
|
|
||||||
|
onStdout: function(data) {
|
||||||
|
let line = data.trim()
|
||||||
|
|
||||||
|
logModel.append({ text: line })
|
||||||
|
|
||||||
|
if (line.startsWith("STEP:")) {
|
||||||
|
let parts = line.split(":")
|
||||||
|
root.currentStep = parseInt(parts[1])
|
||||||
|
}
|
||||||
|
|
||||||
|
if (line.startsWith("DONE")) {
|
||||||
|
root.status = "done"
|
||||||
|
}
|
||||||
|
|
||||||
|
if (line.startsWith("FAIL")) {
|
||||||
|
root.status = "error"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+42
@@ -0,0 +1,42 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# --- This file has been auto-generated. For permanent changes alter the appropriate block in the README.org. ---
|
||||||
|
set -uo pipefail
|
||||||
|
|
||||||
|
emit() { echo "$1"; }
|
||||||
|
|
||||||
|
step() {
|
||||||
|
echo "STEP:$1:$2"
|
||||||
|
}
|
||||||
|
|
||||||
|
ok() {
|
||||||
|
echo "OK:$1"
|
||||||
|
}
|
||||||
|
|
||||||
|
fail() {
|
||||||
|
echo "FAIL:$1"
|
||||||
|
}
|
||||||
|
|
||||||
|
REPO="/home/$USER/Repos/nixos/Droidnix"
|
||||||
|
HOSTNAME="$(hostname)"
|
||||||
|
cd "$REPO" || exit 1
|
||||||
|
|
||||||
|
step 1 "Fixing ownership"
|
||||||
|
sudo chown -R "$USER":"wheel" "$REPO" || fail "ownership"
|
||||||
|
ok 1
|
||||||
|
|
||||||
|
step 2 "Updating flake"
|
||||||
|
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