Prepare installer for ISO-owned finalization

This commit is contained in:
Ryan Hughes
2026-06-04 18:38:25 -04:00
parent bcf07e424a
commit 06db866467
18 changed files with 246 additions and 54 deletions
+13
View File
@@ -6,6 +6,17 @@ set -e
omarchy-setup-user || true
wait_for_notifications() {
command -v omarchy-shell >/dev/null || return 0
for _ in {1..50}; do
omarchy-shell notifications ping >/dev/null 2>&1 && return 0
sleep 0.1
done
return 0
}
state_dir=~/.local/state/omarchy
mkdir -p "$state_dir"
@@ -16,6 +27,8 @@ if [[ ! -f $USER_MARKER ]]; then
bash "$OMARCHY_PATH/install/user/hardware/recover-internal-monitor.sh"
bash "$OMARCHY_PATH/install/user/first-run/gnome-theme.sh"
bash "$OMARCHY_PATH/install/user/first-run/gtk-primary-paste.sh"
wait_for_notifications
bash "$OMARCHY_PATH/install/user/first-run/welcome.sh"
bash "$OMARCHY_PATH/install/user/first-run/wifi.sh"
-1
View File
@@ -58,5 +58,4 @@ export OMARCHY_INSTALL_LOG_FILE="${OMARCHY_INSTALL_LOG_FILE:-/var/log/omarchy-in
export PATH="$OMARCHY_PATH/bin:$PATH"
source "$OMARCHY_INSTALL/helpers/logging.sh"
source "$OMARCHY_INSTALL/helpers/chroot.sh"
source "$OMARCHY_INSTALL/hardware/all.sh"
-2
View File
@@ -71,7 +71,6 @@ export OMARCHY_INSTALL_LOG_FILE="${OMARCHY_INSTALL_LOG_FILE:-/var/log/omarchy-in
export PATH="$OMARCHY_PATH/bin:$PATH"
source "$OMARCHY_INSTALL/helpers/logging.sh"
source "$OMARCHY_INSTALL/helpers/chroot.sh"
start_install_log
run_logged "$OMARCHY_INSTALL/config/theme-system.sh"
@@ -86,7 +85,6 @@ omarchy-setup-hardware --install-user "$install_user"
run_logged "$OMARCHY_INSTALL/login/sddm.sh"
run_logged "$OMARCHY_INSTALL/post-install/dns-resolver.sh"
run_logged "$OMARCHY_INSTALL/post-install/pacman.sh"
run_logged "$OMARCHY_INSTALL/post-install/udev.sh"
run_logged "$OMARCHY_INSTALL/post-install/localdb.sh"
+26 -10
View File
@@ -56,21 +56,18 @@ snapshot_current_background() {
snapshot_background_path "$current_background" "previous"
}
set_theme_background() {
choose_theme_background() {
local backgrounds=()
local current_background index new_background next_index new_background_snapshot
local current_background index next_index i
CHOSEN_THEME_BACKGROUND=""
mapfile -d '' -t backgrounds < <(
find -L "$HOME/.config/omarchy/backgrounds/$THEME_NAME/" "$CURRENT_THEME_PATH/backgrounds/" -maxdepth 1 -type f \
\( -iname '*.jpg' -o -iname '*.jpeg' -o -iname '*.png' -o -iname '*.gif' -o -iname '*.bmp' -o -iname '*.webp' \) \
-print0 2>/dev/null | sort -z
)
if (( ${#backgrounds[@]} == 0 )); then
omarchy-notification-send "No background was found for theme" -t 2000
shell_ipc shell applyTheme "$colors_payload" "$shell_payload" || true
return
fi
(( ${#backgrounds[@]} > 0 )) || return 1
current_background=$(readlink "$CURRENT_BACKGROUND_LINK" 2>/dev/null || true)
index=-1
@@ -82,12 +79,28 @@ set_theme_background() {
done
if (( index == -1 )); then
new_background="${backgrounds[0]}"
CHOSEN_THEME_BACKGROUND="${backgrounds[0]}"
else
next_index=$(((index + 1) % ${#backgrounds[@]}))
new_background="${backgrounds[$next_index]}"
CHOSEN_THEME_BACKGROUND="${backgrounds[$next_index]}"
fi
}
set_theme_background_link() {
choose_theme_background || return 1
ln -nsf "$CHOSEN_THEME_BACKGROUND" "$CURRENT_BACKGROUND_LINK"
}
set_theme_background() {
local new_background new_background_snapshot
if ! choose_theme_background; then
omarchy-notification-send "No background was found for theme" -t 2000
shell_ipc shell applyTheme "$colors_payload" "$shell_payload" || true
return
fi
new_background="$CHOSEN_THEME_BACKGROUND"
new_background_snapshot=$(snapshot_background_path "$new_background" "next")
if [[ -f $OLD_BACKGROUND_SNAPSHOT && -f $new_background_snapshot ]]; then
@@ -159,7 +172,10 @@ echo "$THEME_NAME" >"$HOME/.config/omarchy/current/theme.name"
colors_payload=$([[ -f $CURRENT_THEME_PATH/colors.toml ]] && base64 -w 0 "$CURRENT_THEME_PATH/colors.toml")
shell_payload=$([[ -f $CURRENT_THEME_PATH/shell.toml ]] && base64 -w 0 "$CURRENT_THEME_PATH/shell.toml")
if [[ $THEME_HEADLESS == "1" ]]; then
: # No shell/session bus exists during ISO chroot finalization.
# No shell/session bus exists during ISO chroot finalization, but the first
# real login still needs a current background symlink for omarchy-shell to
# render.
[[ $OMARCHY_THEME_SKIP_BACKGROUND == "1" ]] || set_theme_background_link || true
elif [[ $OMARCHY_THEME_SKIP_BACKGROUND == "1" ]]; then
shell_ipc shell applyTheme "$colors_payload" "$shell_payload" || true
else
+4 -1
View File
@@ -68,7 +68,10 @@ install)
TARGET_OMARCHY_LOG="/mnt/var/log/omarchy-install.log"
cat "$SYSTEM_INFO" >"$TEMP_LOG"
[[ -s $ARCHINSTALL_LOG ]] && cat "$ARCHINSTALL_LOG" >>"$TEMP_LOG"
if [[ -s $ARCHINSTALL_LOG ]]; then
printf '\n========================================\nARCHINSTALL SUBSYSTEM LOG (%s)\n========================================\n\n' "$ARCHINSTALL_LOG" >>"$TEMP_LOG"
cat "$ARCHINSTALL_LOG" >>"$TEMP_LOG"
fi
if [[ -s $LIVE_OMARCHY_LOG ]]; then
printf '\n========================================\nOMARCHY INSTALL LOG (%s)\n========================================\n\n' "$LIVE_OMARCHY_LOG" >>"$TEMP_LOG"