From f00717ff6fd1c72d61b6928444fbf26a3f5e0e64 Mon Sep 17 00:00:00 2001 From: Daniel Girtler Date: Mon, 2 May 2022 21:01:50 +1000 Subject: Fix #1106 (#1119) * Fix #1106 * flake8 * flake8 Co-authored-by: Daniel Girtler --- profiles/i3.py | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) (limited to 'profiles/i3.py') diff --git a/profiles/i3.py b/profiles/i3.py index 24956209..3283848e 100644 --- a/profiles/i3.py +++ b/profiles/i3.py @@ -27,20 +27,21 @@ def _prep_function(*args, **kwargs): supported_configurations = ['i3-wm', 'i3-gaps'] - desktop = archinstall.Menu('Select your desired configuration', supported_configurations, skip=False).run() - - # Temporarily store the selected desktop profile - # in a session-safe location, since this module will get reloaded - # the next time it gets executed. - archinstall.storage['_i3_configuration'] = desktop - - # i3 requires a functioning Xorg installation. - profile = archinstall.Profile(None, 'xorg') - with profile.load_instructions(namespace='xorg.py') as imported: - if hasattr(imported, '_prep_function'): - return imported._prep_function() - else: - print('Deprecated (??): xorg profile has no _prep_function() anymore') + desktop = archinstall.Menu('Select your desired configuration', supported_configurations).run() + + if desktop: + # Temporarily store the selected desktop profile + # in a session-safe location, since this module will get reloaded + # the next time it gets executed. + archinstall.storage['_i3_configuration'] = desktop + + # i3 requires a functioning Xorg installation. + profile = archinstall.Profile(None, 'xorg') + with profile.load_instructions(namespace='xorg.py') as imported: + if hasattr(imported, '_prep_function'): + return imported._prep_function() + else: + print('Deprecated (??): xorg profile has no _prep_function() anymore') if __name__ == 'i3': -- cgit v1.2.3-54-g00ecf