This might work to make the i3 profiles as small as possible

This commit is contained in:
Dylan Taylor 2021-04-08 21:23:29 -04:00
parent 7e161d187c
commit 82c5241946
3 changed files with 11 additions and 17 deletions

View File

@ -9,14 +9,7 @@ def _prep_function(*args, **kwargs):
other code in this stage. So it's a safe way to ask the user other code in this stage. So it's a safe way to ask the user
for more input before any other installer steps start. for more input before any other installer steps start.
""" """
return True
# 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-gaps': if __name__ == 'i3-gaps':
# install the i3 group now # install the i3 group now

View File

@ -9,14 +9,7 @@ def _prep_function(*args, **kwargs):
other code in this stage. So it's a safe way to ask the user other code in this stage. So it's a safe way to ask the user
for more input before any other installer steps start. for more input before any other installer steps start.
""" """
return True
# 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-wm': if __name__ == 'i3-wm':
# install the i3 group now # install the i3 group now

View File

@ -24,6 +24,14 @@ def _prep_function(*args, **kwargs):
# the next time it gets executed. # the next time it gets executed.
archinstall.storage['_desktop_profile'] = desktop archinstall.storage['_desktop_profile'] = 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')
profile = archinstall.Profile(None, desktop) profile = archinstall.Profile(None, desktop)
# Loading the instructions with a custom namespace, ensures that a __name__ comparison is never triggered. # Loading the instructions with a custom namespace, ensures that a __name__ comparison is never triggered.
with profile.load_instructions(namespace=f"{desktop}.py") as imported: with profile.load_instructions(namespace=f"{desktop}.py") as imported: