aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--AGENTS.md8
-rwxr-xr-xreload.sh36
2 files changed, 44 insertions, 0 deletions
diff --git a/AGENTS.md b/AGENTS.md
index 138148f..83c1b2d 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -308,6 +308,14 @@ the whole screen use `ExclusionMode.Ignore`.
| a component's QML | quickshell hot-reloads on save; no restart |
| palette | regenerate with `udt-accent <wallpaper>`; watched, no restart |
| Hyprland binds, layer rules, autostart | `hyprctl reload` |
+| a running shell in a bad state | `./reload.sh [component...]`, from the user's terminal |
+
+`reload.sh` restarts components rather than hot-reloading them. The volume OSD
+once drew only its label, with the icon, bar and device line clipped off, and
+a hot reload fixed it while the code and the layout both measured correct, so
+the stuck state lived in the running process. Do not run the script from an
+agent's tool call: the detached `qs` it starts dies with the call (see
+Verifying above), which leaves the user's desktop without its shells.
Hot reload covers adding and removing windows too: the keepalive window above
was added to a running shell and took effect on save.
diff --git a/reload.sh b/reload.sh
new file mode 100755
index 0000000..243a132
--- /dev/null
+++ b/reload.sh
@@ -0,0 +1,36 @@
+#!/bin/bash
+# Copyright (C) 2026 Danilo M. <danix@danix.xyz>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# Restart quickshell components. With no argument, every directory holding a
+# shell.qml; otherwise the named ones: ./reload.sh desktop notifications
+#
+# A restart rather than a hot reload: saving a file only rebuilds what
+# quickshell thinks changed, and a stuck window survives that.
+
+cd "$(dirname "$0")" || exit 1
+
+if [ $# -eq 0 ]; then
+ set -- */shell.qml
+ set -- "${@%/shell.qml}"
+fi
+
+for c in "$@"; do
+ c=${c%/}
+ [ -f "$c/shell.qml" ] || { echo "$c: no shell.qml" >&2; continue; }
+ qs kill -p "$PWD/$c" >/dev/null 2>&1
+ setsid -f qs -p "$PWD/$c" >/dev/null 2>&1
+ echo "restarted $c"
+done
+
+sleep 1
+# The process is qs, not quickshell: see AGENTS.md.
+echo "qs running: $(pgrep -cx qs)"