Defer channel switch reboot until after update
This commit is contained in:
+27
-6
@@ -2,6 +2,7 @@
|
||||
|
||||
# omarchy:summary=Restore Omarchy to the package install after reboot
|
||||
# omarchy:group=dev
|
||||
# omarchy:args=[--no-reboot]
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
@@ -10,16 +11,36 @@ if (( EUID == 0 )); then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ ${1:-} == "-h" || ${1:-} == "--help" ]]; then
|
||||
cat <<USAGE
|
||||
Usage: omarchy dev unlink
|
||||
prompt_reboot=1
|
||||
|
||||
if (( $# > 1 )); then
|
||||
echo "Usage: omarchy dev unlink [--no-reboot]" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
case "${1:-}" in
|
||||
"")
|
||||
;;
|
||||
--no-reboot)
|
||||
prompt_reboot=0
|
||||
;;
|
||||
-h|--help)
|
||||
cat <<USAGE
|
||||
Usage: omarchy dev unlink [--no-reboot]
|
||||
|
||||
Writes /etc/omarchy.conf so OMARCHY_PATH resolves to /usr/share/omarchy
|
||||
after reboot. This intentionally does not rewrite the running Hyprland,
|
||||
systemd, shell, or app-launcher environment; reboot to make every layer agree.
|
||||
|
||||
Use --no-reboot when another command will handle the reboot prompt.
|
||||
USAGE
|
||||
exit 0
|
||||
fi
|
||||
exit 0
|
||||
;;
|
||||
*)
|
||||
echo "Usage: omarchy dev unlink [--no-reboot]" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
default_target="/usr/share/omarchy"
|
||||
|
||||
@@ -28,6 +49,6 @@ printf 'export OMARCHY_PATH="%s"\n' "$default_target" | sudo tee /etc/omarchy.co
|
||||
echo "Pointed Omarchy at $default_target"
|
||||
echo
|
||||
|
||||
if gum confirm "Reboot now to activate?"; then
|
||||
if (( prompt_reboot )) && gum confirm "Reboot now to activate?"; then
|
||||
omarchy-system-reboot
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user