Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
ab11379
chore(retro): remove code comments
itsvlxd Aug 14, 2026
71115fe
chore(quickshare): make quickshare disabled by default
itsvlxd Aug 14, 2026
a6f2380
chore(lib): remove some code comments
itsvlxd Aug 14, 2026
783ab99
feat(retro): add zenity package
itsvlxd Aug 14, 2026
b7db10a
feat(update): force stable updates to check for release tags only
itsvlxd Aug 14, 2026
b4674b5
fix(quickshare): fix instant offer declined
itsvlxd Aug 14, 2026
cef0c79
fix(daemon): fix battery notification spam
itsvlxd Aug 14, 2026
93c0474
chore(retroshell): remove battery notification deadcode
itsvlxd Aug 14, 2026
6be7ddf
feat(retro): add hide bluetooth applet on install
itsvlxd Aug 14, 2026
8370df3
feat(settings): add xdg autostart management support
itsvlxd Aug 14, 2026
27fabab
fix(tools): move quickshare & users to tools category
itsvlxd Aug 14, 2026
ec8a2f8
feat(retro): save last stable version
itsvlxd Aug 14, 2026
58f8501
feat(settings): add timeshift backup on branch switch
itsvlxd Aug 14, 2026
70cb8e0
feat(update): make update save last stable branch
itsvlxd Aug 14, 2026
b59c5a9
feat(branch): add a branch management tool
itsvlxd Aug 14, 2026
ed4bf0b
feat(settings): add lazy loading for xdg autostart apps
itsvlxd Aug 14, 2026
e487202
fix(settings): small fix for daemon and logs pages
itsvlxd Aug 14, 2026
4fa4b94
feat(bin): add retro select verion on post
itsvlxd Aug 14, 2026
016c077
chore(bin): make network step be after browser
itsvlxd Aug 14, 2026
4d76226
fix(bin): fix retroinstall not load previous states
itsvlxd Aug 15, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions bin/lib/errors.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ rx_retry_or_exit() {
gum style --foreground 1 --padding "1 0 1 $PADDING_LEFT" "$message"
echo
if gum confirm --negative "Exit" --affirmative "Retry" "Retry?" --padding "$GUM_CONFIRM_PADDING"; then
return 0
exec "${RETRO_INSTALL:-/opt/retrolinux/bin}/retroinstall"
fi
return 1
gum style "Run 'retroinstall' to try again"
exit 1
}

rx_step_error() {
Expand Down
102 changes: 51 additions & 51 deletions bin/lib/handlers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -148,57 +148,57 @@ rx_setup_traps() {
# Global state - always load on module source

rx_save_state() {
cat <<EOF > "$RETRO_STATE"
KEYBOARD="$KEYBOARD"
SYS_LANG="$SYS_LANG"
SYS_ENC="$SYS_ENC"
USER_PASSWORD="$USER_PASSWORD"
USER_NAME="$USER_NAME"
USER_HOSTNAME="$USER_HOSTNAME"
USER_TIMEZONE="$USER_TIMEZONE"
DISK_SELECTED="$DISK_SELECTED"
NETWORK_TYPE="$NETWORK_TYPE"
WIFI_SSID="$WIFI_SSID"
WIFI_PASSWORD="$WIFI_PASSWORD"
ROOT_PASSWORD="$ROOT_PASSWORD"
USER_SUDO="$USER_SUDO"
LUKS_ENABLED="$LUKS_ENABLED"
LUKS_PASSWORD="$LUKS_PASSWORD"
LUKS_ITER_TIME="$LUKS_ITER_TIME"
KERNEL_SELECTION="$KERNEL_SELECTION"
BLUETOOTH_ENABLED="$BLUETOOTH_ENABLED"
PRINT_SERVICE_ENABLED="$PRINT_SERVICE_ENABLED"
CUSTOM_MIRRORS="$CUSTOM_MIRRORS"
MIRROR_REGIONS="$MIRROR_REGIONS"
RX_CURRENT_STEP="$RX_CURRENT_STEP"
RX_START_STEP="${RX_START_STEP:-1}"
RX_SKIP_STEP="$RX_SKIP_STEP"
RX_GO_BACK_TO="$RX_GO_BACK_TO"
SSH_ENABLED="$SSH_ENABLED"
SSH_PORT="$SSH_PORT"
SSH_PASSWORD_LOGIN="$SSH_PASSWORD_LOGIN"
SSH_KEY_LOGIN="$SSH_KEY_LOGIN"
SSH_ROOT_LOGIN="$SSH_ROOT_LOGIN"
GRUB_THEME_CHOICE="$GRUB_THEME_CHOICE"
BOOT_VIDEO_GRUB="$BOOT_VIDEO_GRUB"
GRUB_OS_PROBER="$GRUB_OS_PROBER"
DISPLAY_ASPECT_RATIO="$DISPLAY_ASPECT_RATIO"
DISPLAY_RES_X="$DISPLAY_RES_X"
DISPLAY_RES_Y="$DISPLAY_RES_Y"
AUR_HELPER="$AUR_HELPER"
EDITOR_CHOICE="$EDITOR_CHOICE"
INSTALL_TYPE="$INSTALL_TYPE"
FILEMANAGER_CHOICE="$FILEMANAGER_CHOICE"
BROWSER_CHOICE="$BROWSER_CHOICE"
WALLPAPER_RES="$WALLPAPER_RES"
FINGERPRINT_ENABLED="$FINGERPRINT_ENABLED"
FIREWALL_ENGINE="$FIREWALL_ENGINE"
RICE_MODE="$RICE_MODE"
RETRO_BRANCH="$RETRO_BRANCH"
GRUB_SNAPSHOTS_ENABLED="$GRUB_SNAPSHOTS_ENABLED"
GRUB_TIMEOUT="$GRUB_TIMEOUT"
GRUB_KERNEL="$GRUB_KERNEL"
EOF
{
printf 'KEYBOARD=%q\n' "$KEYBOARD"
printf 'SYS_LANG=%q\n' "$SYS_LANG"
printf 'SYS_ENC=%q\n' "$SYS_ENC"
printf 'USER_PASSWORD=%q\n' "$USER_PASSWORD"
printf 'USER_NAME=%q\n' "$USER_NAME"
printf 'USER_HOSTNAME=%q\n' "$USER_HOSTNAME"
printf 'USER_TIMEZONE=%q\n' "$USER_TIMEZONE"
printf 'DISK_SELECTED=%q\n' "$DISK_SELECTED"
printf 'NETWORK_TYPE=%q\n' "$NETWORK_TYPE"
printf 'WIFI_SSID=%q\n' "$WIFI_SSID"
printf 'WIFI_PASSWORD=%q\n' "$WIFI_PASSWORD"
printf 'ROOT_PASSWORD=%q\n' "$ROOT_PASSWORD"
printf 'USER_SUDO=%q\n' "$USER_SUDO"
printf 'LUKS_ENABLED=%q\n' "$LUKS_ENABLED"
printf 'LUKS_PASSWORD=%q\n' "$LUKS_PASSWORD"
printf 'LUKS_ITER_TIME=%q\n' "$LUKS_ITER_TIME"
printf 'KERNEL_SELECTION=%q\n' "$KERNEL_SELECTION"
printf 'BLUETOOTH_ENABLED=%q\n' "$BLUETOOTH_ENABLED"
printf 'PRINT_SERVICE_ENABLED=%q\n' "$PRINT_SERVICE_ENABLED"
printf 'CUSTOM_MIRRORS=%q\n' "$CUSTOM_MIRRORS"
printf 'MIRROR_REGIONS=%q\n' "$MIRROR_REGIONS"
printf 'RX_CURRENT_STEP=%q\n' "$RX_CURRENT_STEP"
printf 'RX_START_STEP=%q\n' "${RX_START_STEP:-1}"
printf 'RX_SKIP_STEP=%q\n' "$RX_SKIP_STEP"
printf 'RX_GO_BACK_TO=%q\n' "$RX_GO_BACK_TO"
printf 'SSH_ENABLED=%q\n' "$SSH_ENABLED"
printf 'SSH_PORT=%q\n' "$SSH_PORT"
printf 'SSH_PASSWORD_LOGIN=%q\n' "$SSH_PASSWORD_LOGIN"
printf 'SSH_KEY_LOGIN=%q\n' "$SSH_KEY_LOGIN"
printf 'SSH_ROOT_LOGIN=%q\n' "$SSH_ROOT_LOGIN"
printf 'GRUB_THEME_CHOICE=%q\n' "$GRUB_THEME_CHOICE"
printf 'BOOT_VIDEO_GRUB=%q\n' "$BOOT_VIDEO_GRUB"
printf 'GRUB_OS_PROBER=%q\n' "$GRUB_OS_PROBER"
printf 'DISPLAY_ASPECT_RATIO=%q\n' "$DISPLAY_ASPECT_RATIO"
printf 'DISPLAY_RES_X=%q\n' "$DISPLAY_RES_X"
printf 'DISPLAY_RES_Y=%q\n' "$DISPLAY_RES_Y"
printf 'AUR_HELPER=%q\n' "$AUR_HELPER"
printf 'EDITOR_CHOICE=%q\n' "$EDITOR_CHOICE"
printf 'INSTALL_TYPE=%q\n' "$INSTALL_TYPE"
printf 'FILEMANAGER_CHOICE=%q\n' "$FILEMANAGER_CHOICE"
printf 'BROWSER_CHOICE=%q\n' "$BROWSER_CHOICE"
printf 'WALLPAPER_RES=%q\n' "$WALLPAPER_RES"
printf 'FINGERPRINT_ENABLED=%q\n' "$FINGERPRINT_ENABLED"
printf 'FIREWALL_ENGINE=%q\n' "$FIREWALL_ENGINE"
printf 'RICE_MODE=%q\n' "$RICE_MODE"
printf 'RETRO_BRANCH=%q\n' "$RETRO_BRANCH"
printf 'GRUB_SNAPSHOTS_ENABLED=%q\n' "$GRUB_SNAPSHOTS_ENABLED"
printf 'GRUB_TIMEOUT=%q\n' "$GRUB_TIMEOUT"
printf 'GRUB_KERNEL=%q\n' "$GRUB_KERNEL"
} > "$RETRO_STATE"
}

rx_load_state() {
Expand Down
88 changes: 75 additions & 13 deletions bin/post/clone.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,26 +43,88 @@ rx_post_clone_repo() {
return 1
fi

if git ls-remote --exit-code --heads "$RETRO_REPO_URL" "refs/heads/$RETRO_BRANCH" >/dev/null 2>&1; then
if git clone --branch "$RETRO_BRANCH" "$RETRO_REPO_URL" "$target_dir"; then
find "$target_dir" -type f -name "*.sh" -exec chmod 755 {} \;
gum style --foreground 2 "Successfully cloned ${RETRO_BRANCH} from GitHub"
return 0
fi
local branch_args=()
if timeout 30 git ls-remote --exit-code --heads "$RETRO_REPO_URL" "refs/heads/$RETRO_BRANCH" >/dev/null 2>&1; then
branch_args=(--branch "$RETRO_BRANCH")
else
gum style --foreground 3 "Branch ${RETRO_BRANCH} not found, cloning default branch..."
if git clone "$RETRO_REPO_URL" "$target_dir"; then
find "$target_dir" -type f -name "*.sh" -exec chmod 755 {} \;
gum style --foreground 2 "Successfully cloned default branch from GitHub"
return 0
fi

local clone_ok=false
if [[ "$RETRO_BRANCH" == "develop" ]]; then
if timeout 600 git clone --single-branch --depth 1 "${branch_args[@]}" "$RETRO_REPO_URL" "$target_dir"; then
clone_ok=true
fi
else
if timeout 600 git clone --single-branch "${branch_args[@]}" "$RETRO_REPO_URL" "$target_dir"; then
clone_ok=true
fi
fi

if [[ $clone_ok == true ]]; then
find "$target_dir" -type f -name "*.sh" -exec chmod 755 {} \;
local actual_branch
actual_branch=$(git -C "$target_dir" branch --show-current 2>/dev/null)
rx_select_retro_version "$target_dir" "${actual_branch:-$RETRO_BRANCH}"
gum style --foreground 2 "Successfully cloned from GitHub (${actual_branch:-${RETRO_BRANCH:-default}})"
return 0
fi

gum style --foreground 1 "ERROR: Failed to clone repository."
return 1
fi
}

rx_select_retro_version() {
local target_dir="$1"
local branch="${2:-develop}"

if [[ "$branch" == "develop" ]]; then
return 0
fi

local versions
versions=$(git -C "$target_dir" tag -l 2>/dev/null \
| grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' \
| sed 's/^v//' \
| awk -F. '
/^[0-9]+\.[0-9]+\.[0-9]+$/ {
key = $1 "." $2
if (!(key in max) || $3 > max[key]) { max[key] = $3; ver[key] = "v" $0 }
}
END { for (k in ver) print ver[k] }
' \
| sort -Vr)

if [[ -z $versions ]]; then
gum style --foreground 3 "No release versions found, staying on ${branch}"
return 0
fi

local -a options=()
local v
while IFS= read -r v; do
[[ -n $v ]] && options+=("$v")
done <<< "$versions"

local choice=""
if [[ -t 0 ]]; then
rx_clear_logo
choice=$(gum choose --header "Select RetroLinux version (${branch})" "${options[@]}")
fi

if [[ -z $choice ]]; then
gum style --foreground 3 "No version selected, staying on ${branch}"
return 0
fi

if git -C "$target_dir" checkout "$choice" 2>/dev/null; then
gum style --foreground 2 "Checked out ${choice}"
else
gum style --foreground 1 "Failed to checkout ${choice}, staying on ${branch}"
fi
}

rx_install_retro_bootstrap() {
rx_clear_logo
rx_step "Bootstrapping first-boot setup..."
Expand All @@ -72,13 +134,13 @@ rx_install_retro_bootstrap() {
return 0
fi

local username=$(arch-chroot /mnt getent passwd 1000 2>/dev/null | cut -d: -f1)
local username=$(timeout 30 arch-chroot /mnt getent passwd 1000 2>/dev/null | cut -d: -f1)
local home_dir=""
[[ -n $username ]] && home_dir=$(arch-chroot /mnt getent passwd "$username" 2>/dev/null | cut -d: -f6)
[[ -n $username ]] && home_dir=$(timeout 30 arch-chroot /mnt getent passwd "$username" 2>/dev/null | cut -d: -f6)

if [[ -n $username && -n $home_dir ]]; then
gum style --foreground 7 "Creating first-boot autostart script..."
arch-chroot /mnt bash -c "
timeout 60 arch-chroot /mnt bash -c "
mkdir -p '$home_dir/.config/hypr'
autostart_file='$home_dir/.config/hypr/autostart.sh'
cat > \$autostart_file <<'EOF'
Expand Down
2 changes: 1 addition & 1 deletion bin/retroinstall
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ SETUP_SCRIPTS=(
"kernel.sh"
"boot.sh"
"mirrors.sh"
"network.sh"
"bluetooth.sh"
"fingerprint.sh"
"print.sh"
Expand All @@ -51,6 +50,7 @@ SETUP_SCRIPTS=(
"editor.sh"
"filemanager.sh"
"browser.sh"
"network.sh"
"config.sh"
)

Expand Down
2 changes: 1 addition & 1 deletion bin/setup/bluetooth.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ setup_bluetooth() {
rx_load_state
rx_step "Let's setup Bluetooth..."

if gum confirm --affirmative "Yes, enable Bluetooth" --negative "No, skip Bluetooth" "Bluetooth Service" $GUM_CONFIRM_STYLE --padding "$GUM_CONFIRM_PADDING"; then
if gum confirm --affirmative "Yes, enable Bluetooth" --negative "No, skip Bluetooth" "Bluetooth Service" --default="${BLUETOOTH_ENABLED:-true}" $GUM_CONFIRM_STYLE --padding "$GUM_CONFIRM_PADDING"; then
# shellcheck disable=SC2034
BLUETOOTH_ENABLED="true"
else
Expand Down
6 changes: 3 additions & 3 deletions bin/setup/boot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ Custom (Enter manually)"
rx_step "Let's configure your bootloader..."

local custom_res
custom_res=$(gum input --placeholder "1920x1080" --placeholder.foreground 8 --prompt.foreground "#ff79c6" --prompt "Resolution (WxH)> " --padding "$GUM_INPUT_PADDING") || {
custom_res=$(gum input --placeholder "1920x1080" --placeholder.foreground 8 --prompt.foreground "#ff79c6" --prompt "Resolution (WxH)> " --value "$BOOT_VIDEO_GRUB" --padding "$GUM_INPUT_PADDING") || {
selected_resolution="$BOOT_VIDEO_GRUB"
}
[[ -n $custom_res ]] && selected_resolution="$custom_res"
Expand All @@ -109,7 +109,7 @@ Custom (Enter manually)"
gum style --foreground 7 "Detect and add other operating systems (Windows, other Linux distros)"
echo

if gum confirm --affirmative "Yes, enable OS probing" --negative "No, skip OS probing" "OS Probing" $GUM_CONFIRM_STYLE --padding "$GUM_CONFIRM_PADDING"; then
if gum confirm --affirmative "Yes, enable OS probing" --negative "No, skip OS probing" "OS Probing" --default="${GRUB_OS_PROBER:-true}" $GUM_CONFIRM_STYLE --padding "$GUM_CONFIRM_PADDING"; then
GRUB_OS_PROBER="true"
else
GRUB_OS_PROBER="false"
Expand All @@ -121,7 +121,7 @@ Custom (Enter manually)"
gum style --foreground 7 "Include BTRFS snapshots in GRUB boot menu for easy rollback"
echo

if gum confirm --affirmative "Yes, enable snapshots" --negative "No, disable snapshots" "Snapshot Boot" $GUM_CONFIRM_STYLE --padding "$GUM_CONFIRM_PADDING"; then
if gum confirm --affirmative "Yes, enable snapshots" --negative "No, disable snapshots" "Snapshot Boot" --default="${GRUB_SNAPSHOTS_ENABLED:-true}" $GUM_CONFIRM_STYLE --padding "$GUM_CONFIRM_PADDING"; then
GRUB_SNAPSHOTS_ENABLED="true"
else
GRUB_SNAPSHOTS_ENABLED="false"
Expand Down
2 changes: 1 addition & 1 deletion bin/setup/branch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ setup_branch() {
gum style --foreground 7 --padding "0 0 0 $PADDING_LEFT" "Latest development changes, updated continuously. Best for testing."
gum style --foreground 7 --padding "0 0 1 $PADDING_LEFT" "Recommended while Retro Linux is still in development."

if gum confirm --affirmative "Stable (main)" --negative "Rolling (develop)" "Select release branch" $GUM_CONFIRM_STYLE --padding "$GUM_CONFIRM_PADDING"; then
if gum confirm --affirmative "Stable (main)" --negative "Rolling (develop)" "Select release branch" --default="$([[ $RETRO_BRANCH == "main" ]] && echo true || echo false)" $GUM_CONFIRM_STYLE --padding "$GUM_CONFIRM_PADDING"; then
RETRO_BRANCH="main"
else
RETRO_BRANCH="develop"
Expand Down
9 changes: 8 additions & 1 deletion bin/setup/browser.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,14 @@ rx_setup_browser() {

local display_options=("Firefox" "Zen" "Chromium" "None (skip browser)")
local pkg_options=("firefox" "zen-browser-bin" "chromium" "none")
local selection=$(gum choose --header "Select browser to install:" --padding "$GUM_CHOOSE_PADDING" "${display_options[@]}")
local current_browser="Firefox"
case "$BROWSER_CHOICE" in
firefox) current_browser="Firefox" ;;
zen-browser-bin) current_browser="Zen" ;;
chromium) current_browser="Chromium" ;;
none) current_browser="None (skip browser)" ;;
esac
local selection=$(gum choose --selected "$current_browser" --header "Select browser to install:" --padding "$GUM_CHOOSE_PADDING" "${display_options[@]}")

if [[ -z "$selection" ]]; then
gum style --foreground 3 "No browser selected, skipping"
Expand Down
6 changes: 3 additions & 3 deletions bin/setup/display.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ Custom (Enter manually)"
rx_step "Let's configure your display settings..."

local custom_ratio
custom_ratio=$(gum input --placeholder "16:9, 16:10, 21:9, 32:9, etc." --placeholder.foreground 8 --prompt.foreground "#ff79c6" --prompt "Aspect Ratio> " --padding "$GUM_INPUT_PADDING") || {
custom_ratio=$(gum input --placeholder "16:9, 16:10, 21:9, 32:9, etc." --placeholder.foreground 8 --prompt.foreground "#ff79c6" --prompt "Aspect Ratio> " --value "$DISPLAY_ASPECT_RATIO" --padding "$GUM_INPUT_PADDING") || {
DISPLAY_ASPECT_RATIO="16:9"
}
[[ -n $custom_ratio ]] && DISPLAY_ASPECT_RATIO="$custom_ratio"
Expand Down Expand Up @@ -151,7 +151,7 @@ $resolutions"
[[ -n $BOOT_VIDEO_GRUB ]] && current_res="$BOOT_VIDEO_GRUB"

local display_res
display_res=$(echo "$resolutions" | gum choose --height 10 --header "Select display resolution" --padding "$GUM_CHOOSE_PADDING") || {
display_res=$(echo "$resolutions" | gum choose --height 10 --selected "$current_res" --header "Select display resolution" --padding "$GUM_CHOOSE_PADDING") || {
rx_step_error "2" "Resolution selection failed"
rx_retry_or_exit "Display configuration required" || rx_abort
}
Expand All @@ -170,7 +170,7 @@ $resolutions"
rx_step "Let's configure your display settings..."

local custom_res
custom_res=$(gum input --placeholder "1920x1080" --placeholder.foreground 8 --prompt.foreground "#ff79c6" --prompt "Resolution (WxH)> " --padding "$GUM_INPUT_PADDING") || {
custom_res=$(gum input --placeholder "1920x1080" --placeholder.foreground 8 --prompt.foreground "#ff79c6" --prompt "Resolution (WxH)> " --value "$BOOT_VIDEO_GRUB" --padding "$GUM_INPUT_PADDING") || {
display_res="1920x1080"
}
[[ -n $custom_res ]] && display_res="$custom_res"
Expand Down
2 changes: 1 addition & 1 deletion bin/setup/hostname.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ setup_hostname() {

while true; do
local hostname
hostname=$(gum input --placeholder "Please set the hostname for your computer" --placeholder.foreground 8 --prompt.foreground "#ff79c6" --prompt "Hostname> " --value "retrolinux" --padding "$GUM_INPUT_PADDING") || {
hostname=$(gum input --placeholder "Please set the hostname for your computer" --placeholder.foreground 8 --prompt.foreground "#ff79c6" --prompt "Hostname> " --value "${USER_HOSTNAME:-retrolinux}" --padding "$GUM_INPUT_PADDING") || {
rx_step_error "2" "Hostname input failed"
rx_retry_or_exit "Hostname is required" || rx_abort
return 1
Expand Down
2 changes: 1 addition & 1 deletion bin/setup/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ setup_install() {
gum style --foreground 7 --padding "0 0 0 $PADDING_LEFT" "Installs only core system modules: essential services, package"
gum style --foreground 7 --padding "0 0 1 $PADDING_LEFT" "management, and basic desktop functionality. Lightweight setup."

if gum confirm --affirmative "Complete install" --negative "Minimal install" "Select Installation Type" $GUM_CONFIRM_STYLE --padding "$GUM_CONFIRM_PADDING"; then
if gum confirm --affirmative "Complete install" --negative "Minimal install" "Select Installation Type" --default="$([[ $INSTALL_TYPE == "complete" ]] && echo true || echo false)" $GUM_CONFIRM_STYLE --padding "$GUM_CONFIRM_PADDING"; then
INSTALL_TYPE="complete"
else
INSTALL_TYPE="minimal"
Expand Down
2 changes: 1 addition & 1 deletion bin/setup/keyboard.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Turkish
Ukrainian'

local choice
choice=$(printf '%s\n' "$keyboards" | gum filter --height "$GUM_FILTER_HEIGHT" "${GUM_FILTER_STYLE[@]}" --prompt "Keyboard> " --placeholder "Please select your keyboard layout" --padding "$GUM_FILTER_PADDING") || {
choice=$(printf '%s\n' "$keyboards" | gum filter --height "$GUM_FILTER_HEIGHT" "${GUM_FILTER_STYLE[@]}" --value "$(rx_keyboard_display_name "$KEYBOARD")" --prompt "Keyboard> " --placeholder "Please select your keyboard layout" --padding "$GUM_FILTER_PADDING") || {
rx_step_error "1" "Keyboard selection cancelled"
rx_retry_or_exit "Keyboard selection is required" || rx_abort
return 1
Expand Down
13 changes: 12 additions & 1 deletion bin/setup/locale.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,19 @@ setup_locale() {
done
lang_list=$(echo "$lang_list" | sort | uniq)

local current_lang=""
if [[ -n $SYS_LANG ]]; then
local saved_code="${SYS_LANG%%.*}"
for code in "${!LOCALE_LANG_NAMES[@]}"; do
if [[ "$code" == "$saved_code" ]]; then
current_lang="${LOCALE_LANG_NAMES[$code]}"
break
fi
done
fi

local choice
choice=$(echo "$lang_list" | gum filter --height "$GUM_FILTER_HEIGHT" "${GUM_FILTER_STYLE[@]}" --prompt "Language> " --placeholder "Please select your system language" --padding "$GUM_FILTER_PADDING") || {
choice=$(echo "$lang_list" | gum filter --height "$GUM_FILTER_HEIGHT" "${GUM_FILTER_STYLE[@]}" --value "$current_lang" --prompt "Language> " --placeholder "Please select your system language" --padding "$GUM_FILTER_PADDING") || {
rx_step_error "1" "Language selection cancelled"
rx_retry_or_exit "Language selection is required" || rx_abort
return 1
Expand Down
Loading
Loading