Adds a timer to post install screen (#4028)

* Add timer to end screen of guided

* ruff check
This commit is contained in:
HADEON 2025-12-25 01:06:03 +01:00 committed by GitHub
parent 9e7a5f6931
commit e5ccdb0c1c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 3 deletions

View File

@ -268,8 +268,12 @@ def add_number_of_parallel_downloads(preset: int | None = None) -> int | None:
return downloads
def ask_post_installation() -> PostInstallationAction:
header = tr('Installation completed') + '\n\n'
def ask_post_installation(elapsed_time: float | None = None) -> PostInstallationAction:
header = 'Installation completed'
if elapsed_time is not None:
minutes = int(elapsed_time // 60)
seconds = int(elapsed_time % 60)
header += f' in {minutes}m {seconds}s' + '\n'
header += tr('What would you like to do next?') + '\n'
items = [MenuItem(action.value, value=action) for action in PostInstallationAction]

View File

@ -1,4 +1,5 @@
import os
import time
from pathlib import Path
from archinstall import SysInfo
@ -53,6 +54,7 @@ def perform_installation(mountpoint: Path) -> None:
Only requirement is that the block devices are
formatted and setup prior to entering this function.
"""
start_time = time.time()
info('Starting installation...')
config = arch_config_handler.config
@ -168,7 +170,8 @@ def perform_installation(mountpoint: Path) -> None:
if not arch_config_handler.args.silent:
with Tui():
action = ask_post_installation()
elapsed_time = time.time() - start_time
action = ask_post_installation(elapsed_time)
match action:
case PostInstallationAction.EXIT: