Skip to content

Commit e5ccdb0

Browse files
authored
Adds a timer to post install screen (#4028)
* Add timer to end screen of guided * ruff check
1 parent 9e7a5f6 commit e5ccdb0

2 files changed

Lines changed: 10 additions & 3 deletions

File tree

archinstall/lib/interactions/general_conf.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,8 +268,12 @@ def validator(s: str | None) -> str | None:
268268
return downloads
269269

270270

271-
def ask_post_installation() -> PostInstallationAction:
272-
header = tr('Installation completed') + '\n\n'
271+
def ask_post_installation(elapsed_time: float | None = None) -> PostInstallationAction:
272+
header = 'Installation completed'
273+
if elapsed_time is not None:
274+
minutes = int(elapsed_time // 60)
275+
seconds = int(elapsed_time % 60)
276+
header += f' in {minutes}m {seconds}s' + '\n'
273277
header += tr('What would you like to do next?') + '\n'
274278

275279
items = [MenuItem(action.value, value=action) for action in PostInstallationAction]

archinstall/scripts/guided.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import os
2+
import time
23
from pathlib import Path
34

45
from archinstall import SysInfo
@@ -53,6 +54,7 @@ def perform_installation(mountpoint: Path) -> None:
5354
Only requirement is that the block devices are
5455
formatted and setup prior to entering this function.
5556
"""
57+
start_time = time.time()
5658
info('Starting installation...')
5759

5860
config = arch_config_handler.config
@@ -168,7 +170,8 @@ def perform_installation(mountpoint: Path) -> None:
168170

169171
if not arch_config_handler.args.silent:
170172
with Tui():
171-
action = ask_post_installation()
173+
elapsed_time = time.time() - start_time
174+
action = ask_post_installation(elapsed_time)
172175

173176
match action:
174177
case PostInstallationAction.EXIT:

0 commit comments

Comments
 (0)