Restart the shell unconditionally after every update
Updates routinely replace the shell's QML, and a stale process can lazy-load new files into old code. Restarting at the end of every omarchy update removes the need for migrations to restart the shell or defer one with the restart-shell-required marker: the login-time migration path already runs a fresh shell that hot-reloads shell.json. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
72ffd58316
commit
c992cdff10
@@ -42,3 +42,9 @@ for file in "$HOME"/.local/state/omarchy/restart-*-required; do
|
||||
omarchy-restart-"$service"
|
||||
fi
|
||||
done
|
||||
|
||||
# Updates routinely replace the shell's QML, and a stale process can lazy-load
|
||||
# new files into old code. A restart failure (locked session, ssh, TTY) only
|
||||
# prints its reason: the next update or login gets a fresh shell anyway.
|
||||
echo "Restarting shell"
|
||||
omarchy-restart-shell || true
|
||||
|
||||
@@ -127,6 +127,9 @@ New migration format:
|
||||
- Use helper commands such as `omarchy-cmd-present`, `omarchy-cmd-missing`,
|
||||
`omarchy-pkg-add`, `omarchy-pkg-drop`, `omarchy-pkg-present`, and
|
||||
`omarchy-pkg-missing` when appropriate.
|
||||
- Never restart the Omarchy shell. `omarchy update` restarts it unconditionally
|
||||
after migrations run, and the login-time shell already runs current code and
|
||||
hot-reloads `shell.json` edits.
|
||||
|
||||
Example:
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ The design goal is:
|
||||
| `~/.local/state/omarchy/current/` | user | Generated active theme, selected theme name, and current background symlink. |
|
||||
| `~/.local/state/omarchy/migrations/` | user | Per-user migration markers. |
|
||||
| `~/.local/state/omarchy/reboot-required` | user | Optional reboot marker checked by `omarchy-update-restart`. |
|
||||
| `~/.local/state/omarchy/restart-*-required` | user | Optional service/app restart markers checked by `omarchy-update-restart`. |
|
||||
| `~/.local/state/omarchy/restart-*-required` | user | Optional service/app restart markers checked by `omarchy-update-restart`. The shell needs no marker: it is restarted unconditionally after every update. |
|
||||
|
||||
## Migration layout
|
||||
|
||||
@@ -261,7 +261,7 @@ scripts.
|
||||
| `omarchy-update-mise` | Runs `mise up` for mise-managed tools. | **Keep.** Mise-managed tools are intentionally part of the blessed update path. |
|
||||
| `omarchy-update-orphan-pkgs` | Lists orphans and prompts before removal; noninteractive mode never removes. | **Keep for now.** Safe because it is prompt-only. |
|
||||
| `omarchy-update-analyze-logs` | Scans `/tmp/omarchy-update.log` for known failure patterns, currently initramfs generation. | **Keep/expand.** Useful safety net; should grow only for high-signal checks. |
|
||||
| `omarchy-update-restart` | Prompts for reboot after kernel/Hyprland updates and restarts components with `restart-*-required` markers. | **Keep.** Important final step; may eventually include service-restart checks. |
|
||||
| `omarchy-update-restart` | Prompts for reboot after kernel/Hyprland updates, restarts components with `restart-*-required` markers, and always restarts the shell. | **Keep.** Important final step; may eventually include service-restart checks. |
|
||||
| `omarchy-update-firmware` | Manual firmware update command using fwupd. Not part of the normal update pipeline. | **Keep separate.** Firmware is not a routine system update step. |
|
||||
| `omarchy-update-time` | Restarts `systemd-timesyncd`. | **Question.** Not really an update command. Consider renaming/moving under system/time maintenance. |
|
||||
|
||||
|
||||
@@ -5,5 +5,4 @@ if ! omarchy-pkg-present quickshell-git; then
|
||||
# quickshell package in place; packages depending on quickshell stay
|
||||
# satisfied through the provides.
|
||||
sudo pacman -S --noconfirm --ask 4 quickshell-git
|
||||
omarchy-state set restart-shell-required
|
||||
fi
|
||||
|
||||
@@ -37,5 +37,3 @@ if [[ -s $config_file ]]; then
|
||||
.bar.layout.center |= place_indicators_before_clock
|
||||
' "$config_file" >"$tmp" && mv "$tmp" "$config_file" || rm -f "$tmp"
|
||||
fi
|
||||
|
||||
omarchy-restart-shell
|
||||
|
||||
@@ -118,7 +118,3 @@ if [[ -s $config_file ]] && grep -q 'TmuxAlert' "$config_file"; then
|
||||
|
||||
rm -f "$tmp"
|
||||
fi
|
||||
|
||||
# Nothing to restart from a TTY or over ssh, and that is no reason to stop the
|
||||
# rest of the queue: hand it to the post-update restart instead.
|
||||
omarchy-restart-shell >/dev/null 2>&1 || omarchy-state set restart-shell-required
|
||||
|
||||
@@ -45,5 +45,3 @@ if [[ -s $config_file ]] && omarchy-cmd-present jq; then
|
||||
end
|
||||
' "$config_file" >"$tmp" && mv "$tmp" "$config_file" || rm -f "$tmp"
|
||||
fi
|
||||
|
||||
omarchy-restart-shell
|
||||
|
||||
@@ -234,13 +234,8 @@ pass "alert removal handles the older indicators key"
|
||||
fail "alert removal leaves an already-empty list alone" "$(jq -c '.bar.layout.right[1]' "$shell_config")"
|
||||
pass "alert removal leaves an already-empty list alone"
|
||||
|
||||
(($(wc -l <"$SHELL_RESTARTS") == 1)) || fail "alert removal restarts the shell"
|
||||
[[ ! -s $STATE_CALLS ]] || fail "a restarted shell needs no deferred restart" "$(cat "$STATE_CALLS")"
|
||||
pass "alert removal restarts the shell"
|
||||
|
||||
# Migrations run from a TTY or over ssh have no shell to restart, and stopping
|
||||
# there would strand every migration queued behind this one.
|
||||
reset_home
|
||||
SHELL_RESTART_STATUS=1 run_migration
|
||||
grep -Fxq 'set restart-shell-required' "$STATE_CALLS" || fail "an unavailable shell defers its restart" "$(cat "$STATE_CALLS")"
|
||||
pass "an unavailable shell defers its restart"
|
||||
# The running shell hot-reloads shell.json and the post-update restart is
|
||||
# unconditional, so the migration itself never touches the shell.
|
||||
[[ ! -s $SHELL_RESTARTS ]] || fail "alert removal leaves shell restarts to the update" "$(cat "$SHELL_RESTARTS")"
|
||||
[[ ! -s $STATE_CALLS ]] || fail "alert removal defers no shell restart" "$(cat "$STATE_CALLS")"
|
||||
pass "alert removal leaves shell restarts to the update"
|
||||
|
||||
Reference in New Issue
Block a user