diff options
author | xengineering <mail2xengineering@protonmail.com> | 2020-01-12 11:10:37 +0100 |
---|---|---|
committer | xengineering <mail2xengineering@protonmail.com> | 2020-01-12 11:10:37 +0100 |
commit | 6423b8cd7a83df5a0d823efe06720f7f0ce71a21 (patch) | |
tree | 9da88c9050346814a7ade6d1ca1415dbb4a85d77 | |
parent | 9a0a971240c5fac8e68c13ac61a9ddef5dabeb83 (diff) | |
download | archinstall-6423b8cd7a83df5a0d823efe06720f7f0ce71a21.tar archinstall-6423b8cd7a83df5a0d823efe06720f7f0ce71a21.tar.zst archinstall-6423b8cd7a83df5a0d823efe06720f7f0ce71a21.zip |
Improved usability of write_config.py.
-rw-r--r-- | util/write_config.py | 32 |
1 files changed, 26 insertions, 6 deletions
diff --git a/util/write_config.py b/util/write_config.py index 17653f1..2c694eb 100644 --- a/util/write_config.py +++ b/util/write_config.py @@ -26,26 +26,39 @@ import subprocess config_file_path = sys.argv[1] # e.g. "/etc/archinstall/config.json" +def print_separator(): + print() + print("#################################################################") + print() + + config = {} # Disk selection -print("Please type in the 'NAME' of the hard disk on which you want to install Arch Linux:") +print_separator() +print("Please type in the 'NAME' of the hard disk on which you want to \ninstall Arch Linux:") +print() subprocess.run("lsblk -o NAME,SIZE,TYPE | grep -v part", shell=True) -config["disk"] = input() +print() +config["disk"] = input(">>> ") # Select hostname +print_separator() print("Please type in the hostname of your new machine:") -config["hostname"] = input() +print() +config["hostname"] = input(">>> ") # Desktop or no desktop +print_separator() print("Do you want to install a desktop? [Y/n]:") -answer = input() +print() +answer = input(">>> ") if answer in ["", "Y", "y", "Yes", "yes"]: config["desktop"] = "yes" else: @@ -54,16 +67,20 @@ else: # Admin account +print_separator() print("Please select your username (like 'paul' or 'alice'):") -config["admin_username"] = input() +print() +config["admin_username"] = input(">>> ") # System encryption +print_separator() print("System encryption protects all your data if your device is stolen.") print("A second password will be required at startup to decrypt the system.") print("Do you want to encrypt your system? [Y/n]") -answer = input() +print() +answer = input(">>> ") if answer in ["", "Y", "y", "Yes", "yes"]: config["system_encryption"] = "yes" else: @@ -79,7 +96,10 @@ with open(config_file_path, 'w') as f: # Output json config for logging purpose +print_separator() print("Config for this installation:") +print() print(config_json) +print_separator() print("Wrote config - OK") |