aboutsummaryrefslogtreecommitdiffstats
path: root/bin/udt-homepage
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-09-29 11:56:14 +0200
committerDanilo M. <danix@danix.xyz>2026-09-29 11:56:14 +0200
commit3bcadc0fd35cb1e077a77c847bbc044ca2fabce3 (patch)
tree9cc8bb74806eb266b0244c40858dfa0b9e9026e2 /bin/udt-homepage
parentff7dcf3ef2338a0aef1856a33da06d1a92c2434c (diff)
downloadunified-desktop-theme-3bcadc0fd35cb1e077a77c847bbc044ca2fabce3.tar.gz
unified-desktop-theme-3bcadc0fd35cb1e077a77c847bbc044ca2fabce3.zip
feat(steps): hand pending root steps to a quickshell window
Notification balloons carried the GRUB and homepage root commands, but a balloon cannot stay open while its commands are pasted into a root shell. bin/udt-steps NAME writes a consumer's pending steps to ~/.cache/udt/steps/NAME and pokes quickshell's appearance shell, which shows one tab per file on DP-3. Empty stdin clears the tab, so producers report on every run and a consumer that caught up drops out by itself. udt-grub and udt-homepage now route through it. install.sh's SDDM block checks what is installed and reports only the steps still missing, rather than printing the full install on every run. udt-homepage remembers the last staged pair, since udt-accent now also runs on icon switches, which change neither file and would re-raise the finish steps for nothing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'bin/udt-homepage')
-rwxr-xr-xbin/udt-homepage33
1 files changed, 21 insertions, 12 deletions
diff --git a/bin/udt-homepage b/bin/udt-homepage
index 7be5d16..a814d16 100755
--- a/bin/udt-homepage
+++ b/bin/udt-homepage
@@ -4,13 +4,17 @@
# Licensed under the GNU General Public License v2 only.
#
# Staged, not installed: /opt/homepage is root-owned and this script does not
-# hold root there, so it copies into ~/hp-stage/ and a notification carries
-# the command that finishes the job.
+# hold root there, so it copies into ~/hp-stage/ and the steps window
+# (udt-steps) carries the commands that finish the job.
#
# udt-accent starts this detached on every run, which covers both a wallpaper
# change (wallp) and a scheme switch (install.sh). Never slow and never loud
# when the host is away: a laptop off that network gets a short connect
-# timeout and no notification, since there is nothing for the user to do.
+# timeout and no steps tab, since there is nothing for the user to do.
+#
+# udt-accent also runs for reasons that change neither file, an icon theme
+# switch for one, so what was last staged is remembered and an identical pair
+# is not staged again: the finish steps would reappear for nothing.
repo="$(dirname "$(readlink -f "$0")")/.."
css="$repo/templates/homepage/custom.css"
@@ -31,6 +35,10 @@ case "$ext" in
esac
bg="background.$ext"
+stamp="$HOME/.cache/udt/homepage.staged"
+sum="$(cat "$css" "$real" | sha256sum)"
+[ "$sum" = "$(cat "$stamp" 2>/dev/null)" ] && exit 0
+
scp "${opts[@]}" "$css" homepage:hp-stage/custom.css &&
scp "${opts[@]}" "$real" "homepage:hp-stage/$bg" || {
echo "homepage: unreachable, skipped" >&2
@@ -41,13 +49,14 @@ scp "${opts[@]}" "$css" homepage:hp-stage/custom.css &&
# is not the staging directory, so it is named through the ssh login user,
# which ssh -G resolves from the config without connecting.
stage="~$(ssh -G homepage 2>/dev/null | awk '/^user /{print $2}')/hp-stage"
-finish="cp $stage/custom.css /opt/homepage/config/
-cp $stage/$bg /opt/homepage/public/images/
-sed -i 's|/images/background\.[a-z]*|/images/$bg|' /opt/homepage/config/settings.yaml
-systemctl restart homepage"
-echo "homepage: staged, finish as root on homepage:"
-echo "$finish"
-command -v notify-send >/dev/null 2>&1 &&
- notify-send -a udt "homepage: theme staged" "As root on homepage:
-$finish"
+echo "$sum" > "$stamp"
+out="$(
+ echo "The homepage theme is staged in $stage. Finish as root on homepage:"
+ echo " cp $stage/custom.css /opt/homepage/config/"
+ echo " cp $stage/$bg /opt/homepage/public/images/"
+ echo " sed -i 's|/images/background\\.[a-z]*|/images/$bg|' /opt/homepage/config/settings.yaml"
+ echo " systemctl restart homepage"
+)"
+echo "$out"
+printf '%s' "$out" | "$repo/bin/udt-steps" homepage
exit 0