aboutsummaryrefslogtreecommitdiffstats
path: root/bin/udt-steps
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-steps
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-steps')
-rwxr-xr-xbin/udt-steps36
1 files changed, 36 insertions, 0 deletions
diff --git a/bin/udt-steps b/bin/udt-steps
new file mode 100755
index 0000000..da4aca0
--- /dev/null
+++ b/bin/udt-steps
@@ -0,0 +1,36 @@
+#!/bin/bash
+# udt-steps: hand a consumer's pending manual steps to the steps window.
+# Copyright (C) 2026 Danilo M. <danix@danix.xyz>
+# Licensed under the GNU General Public License v2 only.
+#
+# Usage: <producer> | udt-steps NAME
+#
+# stdin becomes the NAME tab of quickshell's steps window, one file per
+# consumer under ~/.cache/udt/steps/. Empty stdin clears the tab: a consumer
+# that is up to date has nothing to ask for. Either way the running shell is
+# poked over IPC, which reloads the tabs and opens the window when any remain.
+#
+# Format: a line indented two spaces is a command, and a run of them is one
+# block with its own copy button. Everything else is prose. So the root
+# commands producers already printed for a terminal read the same here.
+
+name="${1:?usage: udt-steps NAME}"
+case "$name" in
+ *[!a-z0-9-]*) echo "udt-steps: bad name '$name'" >&2; exit 2 ;;
+esac
+
+dir="$HOME/.cache/udt/steps"
+mkdir -p "$dir"
+text="$(cat)"
+if [ -z "$text" ]; then
+ rm -f "$dir/$name"
+else
+ # Atomic, so the shell never reads half a file.
+ printf '%s\n' "$text" > "$dir/.$name.tmp" && mv "$dir/.$name.tmp" "$dir/$name"
+fi
+
+repo="$(dirname "$(readlink -f "$0")")/.."
+qs_dir="$(realpath -m "$repo/../quickshell/appearance")"
+[ -f "$qs_dir/shell.qml" ] && command -v qs >/dev/null 2>&1 &&
+ timeout 5 qs -p "$qs_dir" ipc call appearance steps >/dev/null 2>&1
+exit 0