From 0d194e2606809fb88eb25e2a1711fbad8a862d27 Mon Sep 17 00:00:00 2001 From: Dylan Taylor Date: Thu, 8 Apr 2021 15:54:54 -0400 Subject: Initial implementation of LXQt --- profiles/applications/lxqt.py | 3 +++ profiles/desktop.py | 2 +- profiles/lxqt.py | 35 +++++++++++++++++++++++++++++++++++ 3 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 profiles/applications/lxqt.py create mode 100644 profiles/lxqt.py diff --git a/profiles/applications/lxqt.py b/profiles/applications/lxqt.py new file mode 100644 index 00000000..f2a75e0e --- /dev/null +++ b/profiles/applications/lxqt.py @@ -0,0 +1,3 @@ +import archinstall + +installation.add_additional_packages("lxqt breeze-icons sddm") diff --git a/profiles/desktop.py b/profiles/desktop.py index d552a17f..4c6255e7 100644 --- a/profiles/desktop.py +++ b/profiles/desktop.py @@ -16,7 +16,7 @@ def _prep_function(*args, **kwargs): for more input before any other installer steps start. """ - supported_desktops = ['gnome', 'kde', 'awesome', 'sway', 'cinnamon', 'xfce4'] + supported_desktops = ['gnome', 'kde', 'awesome', 'sway', 'cinnamon', 'xfce4', 'lxqt'] desktop = archinstall.generic_select(supported_desktops, 'Select your desired desktop environment: ') # Temporarily store the selected desktop profile diff --git a/profiles/lxqt.py b/profiles/lxqt.py new file mode 100644 index 00000000..871488ee --- /dev/null +++ b/profiles/lxqt.py @@ -0,0 +1,35 @@ + +# A desktop environment using "LXQt" + +import archinstall + +is_top_level_profile = False + +def _prep_function(*args, **kwargs): + """ + Magic function called by the importing installer + before continuing any further. It also avoids executing any + other code in this stage. So it's a safe way to ask the user + for more input before any other installer steps start. + """ + + # LXQt requires a functional 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') + +# Ensures that this code only gets executed if executed +# through importlib.util.spec_from_file_location("lxqt", "/somewhere/lxqt.py") +# or through conventional import lxqt +if __name__ == 'lxqt': + # Install dependency profiles + installation.install_profile('xorg') + + # Install the application xfce4 from the template under /applications/ + xfce = archinstall.Application(installation, 'lxqt') + xfce.install() + + installation.enable_service('sddm') # SDDM Display Manager -- cgit v1.2.3-70-g09d2 From adb73f5ba6cfb3f13b821d16784f2f8d60ee29c0 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Thu, 8 Apr 2021 16:10:33 -0400 Subject: It was far too minimal to be usable before. --- profiles/applications/lxqt.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/profiles/applications/lxqt.py b/profiles/applications/lxqt.py index f2a75e0e..42cf80de 100644 --- a/profiles/applications/lxqt.py +++ b/profiles/applications/lxqt.py @@ -1,3 +1,3 @@ import archinstall -installation.add_additional_packages("lxqt breeze-icons sddm") +installation.add_additional_packages("lxqt breeze-icons xdg-utils ttf-freefont leafpad xscreensaver archlinux-wallpaper sddm") -- cgit v1.2.3-70-g09d2 From 9545680459528c63e9dececb0804d9b498130ef6 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Thu, 8 Apr 2021 16:21:46 -0400 Subject: breeze-icons and oxygen-icons are both needed to not have missing icons --- profiles/applications/lxqt.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/profiles/applications/lxqt.py b/profiles/applications/lxqt.py index 42cf80de..87586931 100644 --- a/profiles/applications/lxqt.py +++ b/profiles/applications/lxqt.py @@ -1,3 +1,3 @@ import archinstall -installation.add_additional_packages("lxqt breeze-icons xdg-utils ttf-freefont leafpad xscreensaver archlinux-wallpaper sddm") +installation.add_additional_packages("lxqt breeze-icons oxygen-icons xdg-utils ttf-freefont leafpad xscreensaver archlinux-wallpaper sddm") -- cgit v1.2.3-70-g09d2 From 51f533539dfe499f37e957b87c0c78caf307b747 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Thu, 8 Apr 2021 16:34:17 -0400 Subject: Change xscreensaver to slock --- profiles/applications/lxqt.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/profiles/applications/lxqt.py b/profiles/applications/lxqt.py index 87586931..5ce875cc 100644 --- a/profiles/applications/lxqt.py +++ b/profiles/applications/lxqt.py @@ -1,3 +1,3 @@ import archinstall -installation.add_additional_packages("lxqt breeze-icons oxygen-icons xdg-utils ttf-freefont leafpad xscreensaver archlinux-wallpaper sddm") +installation.add_additional_packages("lxqt breeze-icons oxygen-icons xdg-utils ttf-freefont leafpad slock archlinux-wallpaper sddm") -- cgit v1.2.3-70-g09d2 From 8ec18d94bbd55a99f5aea9c1c37cbdd9ea9c9697 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Thu, 8 Apr 2021 18:28:13 -0400 Subject: Add vim to desktop packages as not everyone likes nano --- profiles/desktop.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/profiles/desktop.py b/profiles/desktop.py index 4c6255e7..3ba9a885 100644 --- a/profiles/desktop.py +++ b/profiles/desktop.py @@ -6,7 +6,7 @@ is_top_level_profile = True # New way of defining packages for a profile, which is iterable and can be used out side # of the profile to get a list of "what packages will be installed". -__packages__ = ['nano', 'openssh', 'htop', 'wget', 'iwd', 'wireless_tools', 'wpa_supplicant', 'smartmontools'] +__packages__ = ['nano', 'vim', 'openssh', 'htop', 'wget', 'iwd', 'wireless_tools', 'wpa_supplicant', 'smartmontools'] def _prep_function(*args, **kwargs): """ -- cgit v1.2.3-70-g09d2 From 32c902a4d8a46f6d0202d9ae46dee9620bbcaa30 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Thu, 8 Apr 2021 20:52:47 -0400 Subject: draft: Make i3 package to select i3 configuration --- profiles/i3.py | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 profiles/i3.py diff --git a/profiles/i3.py b/profiles/i3.py new file mode 100644 index 00000000..3867dfb5 --- /dev/null +++ b/profiles/i3.py @@ -0,0 +1,55 @@ +# Common package for i3, lets user select which i3 configuration they want. + +import archinstall, os + +is_top_level_profile = False + +# New way of defining packages for a profile, which is iterable and can be used out side +# of the profile to get a list of "what packages will be installed". +__packages__ = [] + +def _prep_function(*args, **kwargs): + """ + Magic function called by the importing installer + before continuing any further. It also avoids executing any + other code in this stage. So it's a safe way to ask the user + for more input before any other installer steps start. + """ + + supported_configurations = ['i3-wm', 'i3-gaps'] + desktop = archinstall.generic_select(supported_configurations, 'Select your desired configuration: ') + + # 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['_desktop_profile'] = desktop + + profile = archinstall.Profile(None, desktop) + # 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: + if hasattr(imported, '_prep_function'): + return imported._prep_function() + else: + print(f"Deprecated (??): {desktop} profile has no _prep_function() anymore") + +if __name__ == 'i3': + """ + This "profile" is a meta-profile. + There are no desktop-specific steps, it simply routes + the installer to whichever desktop environment/window manager was chosen. + + Maybe in the future, a network manager or similar things *could* be added here. + We should honor that Arch Linux does not officially endorse a desktop-setup, nor is + it trying to be a turn-key desktop distribution. + + There are plenty of desktop-turn-key-solutions based on Arch Linux, + this is therefore just a helper to get started + """ + + # Install common packages for all i3 configurations + installation.add_additional_packages(__packages__) + + # TODO: Remove magic variable 'installation' and place it + # in archinstall.storage or archinstall.session/archinstall.installation + installation.install_profile(archinstall.storage['_desktop_profile']) + -- cgit v1.2.3-70-g09d2 From 6f4b35c4e8e0c00b51fb05fd53768620b4097c47 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Thu, 8 Apr 2021 20:54:34 -0400 Subject: Add i3 profile to desktop.py --- profiles/desktop.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/profiles/desktop.py b/profiles/desktop.py index 4c6255e7..1bf21482 100644 --- a/profiles/desktop.py +++ b/profiles/desktop.py @@ -16,7 +16,7 @@ def _prep_function(*args, **kwargs): for more input before any other installer steps start. """ - supported_desktops = ['gnome', 'kde', 'awesome', 'sway', 'cinnamon', 'xfce4', 'lxqt'] + supported_desktops = ['gnome', 'kde', 'awesome', 'sway', 'cinnamon', 'xfce4', 'lxqt', 'i3'] desktop = archinstall.generic_select(supported_desktops, 'Select your desired desktop environment: ') # Temporarily store the selected desktop profile -- cgit v1.2.3-70-g09d2 From 6b5b3180f31b4591c7359859cf692d538b47db20 Mon Sep 17 00:00:00 2001 From: advaithm Date: Mon, 5 Apr 2021 20:46:09 +0530 Subject: add i3-wm and i3-gaps support --- profiles/applications/i3-gaps.py | 2 ++ profiles/applications/i3-wm.py | 2 ++ profiles/i3-gaps.py | 28 ++++++++++++++++++++++++++++ profiles/i3-wm.py | 28 ++++++++++++++++++++++++++++ 4 files changed, 60 insertions(+) create mode 100644 profiles/applications/i3-gaps.py create mode 100644 profiles/applications/i3-wm.py create mode 100644 profiles/i3-gaps.py create mode 100644 profiles/i3-wm.py diff --git a/profiles/applications/i3-gaps.py b/profiles/applications/i3-gaps.py new file mode 100644 index 00000000..4dd95989 --- /dev/null +++ b/profiles/applications/i3-gaps.py @@ -0,0 +1,2 @@ +import archinstall +installation.add_additional_packages("i3lock i3status i3blocks i3-gaps") \ No newline at end of file diff --git a/profiles/applications/i3-wm.py b/profiles/applications/i3-wm.py new file mode 100644 index 00000000..8662497d --- /dev/null +++ b/profiles/applications/i3-wm.py @@ -0,0 +1,2 @@ +import archinstall +installation.add_additional_packages("i3lock i3status i3blocks i3-wm") \ No newline at end of file diff --git a/profiles/i3-gaps.py b/profiles/i3-gaps.py new file mode 100644 index 00000000..bf8227ba --- /dev/null +++ b/profiles/i3-gaps.py @@ -0,0 +1,28 @@ +import archinstall + +def _prep_function(*args, **kwargs): + """ + Magic function called by the importing installer + before continuing any further. It also avoids executing any + other code in this stage. So it's a safe way to ask the user + for more input before any other installer steps start. + """ + + # KDE 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': + # Install dependency profiles + installation.install_profile('xorg') + # gaps is installed by deafult so we are overriding it here + installation.add_additional_packages("lightdm-gtk-greeter lightdm") + # install the i3 group now + i3 = archinstall.Application(installation, 'i3-gaps') + i3.install() + # Auto start lightdm for all users + installation.enable_service('lightdm') diff --git a/profiles/i3-wm.py b/profiles/i3-wm.py new file mode 100644 index 00000000..168abb72 --- /dev/null +++ b/profiles/i3-wm.py @@ -0,0 +1,28 @@ +import archinstall + +def _prep_function(*args, **kwargs): + """ + Magic function called by the importing installer + before continuing any further. It also avoids executing any + other code in this stage. So it's a safe way to ask the user + for more input before any other installer steps start. + """ + + # KDE 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': + # Install dependency profiles + installation.install_profile('xorg') + # we are installing lightdm to auto start i3 + installation.add_additional_packages("lightdm-gtk-greeter lightdm") + # install the i3 group now + i3 = archinstall.Application(installation, 'i3-wm') + i3.install() + # Auto start lightdm for all users + installation.enable_service('lightdm') \ No newline at end of file -- cgit v1.2.3-70-g09d2 From 230c5709cc56f4896c7220d768d1da0302bf2cc0 Mon Sep 17 00:00:00 2001 From: advaithm Date: Tue, 6 Apr 2021 07:21:11 +0530 Subject: added _post_install hook. --- profiles/i3-gaps.py | 10 +++++++++- profiles/i3-wm.py | 9 ++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/profiles/i3-gaps.py b/profiles/i3-gaps.py index bf8227ba..d9469dcd 100644 --- a/profiles/i3-gaps.py +++ b/profiles/i3-gaps.py @@ -1,4 +1,4 @@ -import archinstall +import archinstall, subprocess def _prep_function(*args, **kwargs): """ @@ -16,6 +16,14 @@ def _prep_function(*args, **kwargs): else: print('Deprecated (??): xorg profile has no _prep_function() anymore') +def _post_install(*args, **kwargs): + """ + Another magic function called after the system + has been installed. + """ + print("the installation of i3 does not conatain any configuerations for the wm. in this shell you take your time should add your configuerations") + subprocess.check_call("arch-chroot /mnt",shell=True) + if __name__ == 'i3-wm': # Install dependency profiles installation.install_profile('xorg') diff --git a/profiles/i3-wm.py b/profiles/i3-wm.py index 168abb72..8b541bbf 100644 --- a/profiles/i3-wm.py +++ b/profiles/i3-wm.py @@ -1,4 +1,4 @@ -import archinstall +import archinstall, subprocess def _prep_function(*args, **kwargs): """ @@ -15,6 +15,13 @@ def _prep_function(*args, **kwargs): return imported._prep_function() else: print('Deprecated (??): xorg profile has no _prep_function() anymore') +def _post_install(*args, **kwargs): + """ + Another magic function called after the system + has been installed. + """ + print("the installation of i3-gaps does not conatain any configuerations for the wm. in this shell you should take your time to add your configuerations") + subprocess.check_call("arch-chroot /mnt",shell=True) if __name__ == 'i3-wm': # Install dependency profiles -- cgit v1.2.3-70-g09d2 From 8c5af80c93270c463944fd891002d781f2949702 Mon Sep 17 00:00:00 2001 From: Anton Hvornum Date: Tue, 6 Apr 2021 09:53:28 +0200 Subject: Some language correction and function handling I more or less copied the language from i3-wm as it was more correct. Also converted `print()` into `installation.log()` so that we can get some color control and end up in the debug log. Finally, I added a try/except to handle potential crashes and return return values, since otherwise this would happen every run: * https://github.com/archlinux/archinstall/pull/190/files#diff-98d75a109b5337cd7d7c948d2cfc2379bcc51be22dfa3ca6491765f0e0bcaaabR349-R355 --- profiles/i3-gaps.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/profiles/i3-gaps.py b/profiles/i3-gaps.py index d9469dcd..96d972e3 100644 --- a/profiles/i3-gaps.py +++ b/profiles/i3-gaps.py @@ -21,8 +21,13 @@ def _post_install(*args, **kwargs): Another magic function called after the system has been installed. """ - print("the installation of i3 does not conatain any configuerations for the wm. in this shell you take your time should add your configuerations") - subprocess.check_call("arch-chroot /mnt",shell=True) + installation.log("the installation of i3 does not conatain any configuerations for the wm. In this shell you should take your time to add your desiired configueration. Exit the shell once you are done to continue the installation.", fg="yellow") + try: + subprocess.check_call("arch-chroot /mnt",shell=True) + except subprocess.CallProcessError: + return False + + return True if __name__ == 'i3-wm': # Install dependency profiles -- cgit v1.2.3-70-g09d2 From e3ea46ce5c0fc58f142b749aec86ab97a66c0da3 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Tue, 6 Apr 2021 13:27:00 -0400 Subject: Noticed that some KDE instances weren't changed to i3 when copying Another one --- profiles/i3-gaps.py | 2 +- profiles/i3-wm.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/profiles/i3-gaps.py b/profiles/i3-gaps.py index 96d972e3..50511dce 100644 --- a/profiles/i3-gaps.py +++ b/profiles/i3-gaps.py @@ -8,7 +8,7 @@ def _prep_function(*args, **kwargs): for more input before any other installer steps start. """ - # KDE requires a functioning Xorg installation. + # 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'): diff --git a/profiles/i3-wm.py b/profiles/i3-wm.py index 8b541bbf..e700997f 100644 --- a/profiles/i3-wm.py +++ b/profiles/i3-wm.py @@ -8,7 +8,7 @@ def _prep_function(*args, **kwargs): for more input before any other installer steps start. """ - # KDE requires a functioning Xorg installation. + # 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'): -- cgit v1.2.3-70-g09d2 From 8f7d8df89f14a48132f4d5e7a3dfb556492879ff Mon Sep 17 00:00:00 2001 From: Anton Hvornum Date: Tue, 6 Apr 2021 09:54:24 +0200 Subject: Swapped print for log and added return values --- profiles/i3-wm.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/profiles/i3-wm.py b/profiles/i3-wm.py index e700997f..cd6cbc81 100644 --- a/profiles/i3-wm.py +++ b/profiles/i3-wm.py @@ -20,8 +20,13 @@ def _post_install(*args, **kwargs): Another magic function called after the system has been installed. """ - print("the installation of i3-gaps does not conatain any configuerations for the wm. in this shell you should take your time to add your configuerations") - subprocess.check_call("arch-chroot /mnt",shell=True) + installation.log("the installation of i3 does not conatain any configuerations for the wm. In this shell you should take your time to add your desiired configueration. Exit the shell once you are done to continue the installation.", fg="yellow") + try: + subprocess.check_call("arch-chroot /mnt",shell=True) + except subprocess.CallProcessError: + return False + + return True if __name__ == 'i3-wm': # Install dependency profiles @@ -32,4 +37,4 @@ if __name__ == 'i3-wm': i3 = archinstall.Application(installation, 'i3-wm') i3.install() # Auto start lightdm for all users - installation.enable_service('lightdm') \ No newline at end of file + installation.enable_service('lightdm') -- cgit v1.2.3-70-g09d2 From 37db6b8973ef6fbb06ae72505ba836d16bd87d3d Mon Sep 17 00:00:00 2001 From: Dylan Taylor Date: Thu, 8 Apr 2021 20:58:52 -0400 Subject: Add is_top_level_profile = False to i3 profiles --- profiles/i3-gaps.py | 2 ++ profiles/i3-wm.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/profiles/i3-gaps.py b/profiles/i3-gaps.py index 50511dce..e900117a 100644 --- a/profiles/i3-gaps.py +++ b/profiles/i3-gaps.py @@ -1,5 +1,7 @@ import archinstall, subprocess +is_top_level_profile = False + def _prep_function(*args, **kwargs): """ Magic function called by the importing installer diff --git a/profiles/i3-wm.py b/profiles/i3-wm.py index cd6cbc81..a2449e39 100644 --- a/profiles/i3-wm.py +++ b/profiles/i3-wm.py @@ -1,5 +1,7 @@ import archinstall, subprocess +is_top_level_profile = False + def _prep_function(*args, **kwargs): """ Magic function called by the importing installer -- cgit v1.2.3-70-g09d2 From a5eb815b3e9447062aff613ff0100e2c62db851d Mon Sep 17 00:00:00 2001 From: Dylan Taylor Date: Thu, 8 Apr 2021 21:00:55 -0400 Subject: Move common packages to common i3 profile --- profiles/applications/i3-gaps.py | 2 +- profiles/applications/i3-wm.py | 2 +- profiles/i3.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/profiles/applications/i3-gaps.py b/profiles/applications/i3-gaps.py index 4dd95989..4daed7ad 100644 --- a/profiles/applications/i3-gaps.py +++ b/profiles/applications/i3-gaps.py @@ -1,2 +1,2 @@ import archinstall -installation.add_additional_packages("i3lock i3status i3blocks i3-gaps") \ No newline at end of file +installation.add_additional_packages("i3-gaps") \ No newline at end of file diff --git a/profiles/applications/i3-wm.py b/profiles/applications/i3-wm.py index 8662497d..e7838a64 100644 --- a/profiles/applications/i3-wm.py +++ b/profiles/applications/i3-wm.py @@ -1,2 +1,2 @@ import archinstall -installation.add_additional_packages("i3lock i3status i3blocks i3-wm") \ No newline at end of file +installation.add_additional_packages("i3-wm") \ No newline at end of file diff --git a/profiles/i3.py b/profiles/i3.py index 3867dfb5..b9d7495e 100644 --- a/profiles/i3.py +++ b/profiles/i3.py @@ -6,7 +6,7 @@ is_top_level_profile = False # New way of defining packages for a profile, which is iterable and can be used out side # of the profile to get a list of "what packages will be installed". -__packages__ = [] +__packages__ = ['i3lock', 'i3status', 'i3blocks'] def _prep_function(*args, **kwargs): """ -- cgit v1.2.3-70-g09d2 From 6a6439daa929e534fec580a39cbd69087f5f43f2 Mon Sep 17 00:00:00 2001 From: Dylan Taylor Date: Thu, 8 Apr 2021 21:08:17 -0400 Subject: Move more logic into common profile --- profiles/i3-gaps.py | 8 +------- profiles/i3-wm.py | 7 +------ profiles/i3.py | 9 +++++++++ 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/profiles/i3-gaps.py b/profiles/i3-gaps.py index e900117a..d6308ad5 100644 --- a/profiles/i3-gaps.py +++ b/profiles/i3-gaps.py @@ -31,13 +31,7 @@ def _post_install(*args, **kwargs): return True -if __name__ == 'i3-wm': - # Install dependency profiles - installation.install_profile('xorg') - # gaps is installed by deafult so we are overriding it here - installation.add_additional_packages("lightdm-gtk-greeter lightdm") +if __name__ == 'i3-gaps': # install the i3 group now i3 = archinstall.Application(installation, 'i3-gaps') i3.install() - # Auto start lightdm for all users - installation.enable_service('lightdm') diff --git a/profiles/i3-wm.py b/profiles/i3-wm.py index a2449e39..c4c05ec9 100644 --- a/profiles/i3-wm.py +++ b/profiles/i3-wm.py @@ -17,6 +17,7 @@ def _prep_function(*args, **kwargs): return imported._prep_function() else: print('Deprecated (??): xorg profile has no _prep_function() anymore') + def _post_install(*args, **kwargs): """ Another magic function called after the system @@ -31,12 +32,6 @@ def _post_install(*args, **kwargs): return True if __name__ == 'i3-wm': - # Install dependency profiles - installation.install_profile('xorg') - # we are installing lightdm to auto start i3 - installation.add_additional_packages("lightdm-gtk-greeter lightdm") # install the i3 group now i3 = archinstall.Application(installation, 'i3-wm') i3.install() - # Auto start lightdm for all users - installation.enable_service('lightdm') diff --git a/profiles/i3.py b/profiles/i3.py index b9d7495e..c08f4d89 100644 --- a/profiles/i3.py +++ b/profiles/i3.py @@ -49,6 +49,15 @@ if __name__ == 'i3': # Install common packages for all i3 configurations installation.add_additional_packages(__packages__) + # Install dependency profiles + installation.install_profile('xorg') + + # gaps is installed by deafult so we are overriding it here + installation.add_additional_packages("lightdm-gtk-greeter lightdm") + + # Auto start lightdm for all users + installation.enable_service('lightdm') + # TODO: Remove magic variable 'installation' and place it # in archinstall.storage or archinstall.session/archinstall.installation installation.install_profile(archinstall.storage['_desktop_profile']) -- cgit v1.2.3-70-g09d2 From 7e161d187ced4275365cb958d8f066b697bcc141 Mon Sep 17 00:00:00 2001 From: Dylan Taylor Date: Thu, 8 Apr 2021 21:20:00 -0400 Subject: Remove post-install hooks from i3 profiles --- profiles/i3-gaps.py | 13 ------------- profiles/i3-wm.py | 13 ------------- 2 files changed, 26 deletions(-) diff --git a/profiles/i3-gaps.py b/profiles/i3-gaps.py index d6308ad5..395e69f6 100644 --- a/profiles/i3-gaps.py +++ b/profiles/i3-gaps.py @@ -18,19 +18,6 @@ def _prep_function(*args, **kwargs): else: print('Deprecated (??): xorg profile has no _prep_function() anymore') -def _post_install(*args, **kwargs): - """ - Another magic function called after the system - has been installed. - """ - installation.log("the installation of i3 does not conatain any configuerations for the wm. In this shell you should take your time to add your desiired configueration. Exit the shell once you are done to continue the installation.", fg="yellow") - try: - subprocess.check_call("arch-chroot /mnt",shell=True) - except subprocess.CallProcessError: - return False - - return True - if __name__ == 'i3-gaps': # install the i3 group now i3 = archinstall.Application(installation, 'i3-gaps') diff --git a/profiles/i3-wm.py b/profiles/i3-wm.py index c4c05ec9..4c3135e5 100644 --- a/profiles/i3-wm.py +++ b/profiles/i3-wm.py @@ -18,19 +18,6 @@ def _prep_function(*args, **kwargs): else: print('Deprecated (??): xorg profile has no _prep_function() anymore') -def _post_install(*args, **kwargs): - """ - Another magic function called after the system - has been installed. - """ - installation.log("the installation of i3 does not conatain any configuerations for the wm. In this shell you should take your time to add your desiired configueration. Exit the shell once you are done to continue the installation.", fg="yellow") - try: - subprocess.check_call("arch-chroot /mnt",shell=True) - except subprocess.CallProcessError: - return False - - return True - if __name__ == 'i3-wm': # install the i3 group now i3 = archinstall.Application(installation, 'i3-wm') -- cgit v1.2.3-70-g09d2 From 82c5241946ec96223aebe6453c58845182290fbb Mon Sep 17 00:00:00 2001 From: Dylan Taylor Date: Thu, 8 Apr 2021 21:23:29 -0400 Subject: This might work to make the i3 profiles as small as possible --- profiles/i3-gaps.py | 9 +-------- profiles/i3-wm.py | 9 +-------- profiles/i3.py | 10 +++++++++- 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/profiles/i3-gaps.py b/profiles/i3-gaps.py index 395e69f6..ddca34b7 100644 --- a/profiles/i3-gaps.py +++ b/profiles/i3-gaps.py @@ -9,14 +9,7 @@ def _prep_function(*args, **kwargs): other code in this stage. So it's a safe way to ask the user for more input before any other installer steps start. """ - - # 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') + return True if __name__ == 'i3-gaps': # install the i3 group now diff --git a/profiles/i3-wm.py b/profiles/i3-wm.py index 4c3135e5..4a0415fc 100644 --- a/profiles/i3-wm.py +++ b/profiles/i3-wm.py @@ -9,14 +9,7 @@ def _prep_function(*args, **kwargs): other code in this stage. So it's a safe way to ask the user for more input before any other installer steps start. """ - - # 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') + return True if __name__ == 'i3-wm': # install the i3 group now diff --git a/profiles/i3.py b/profiles/i3.py index c08f4d89..9f58e7eb 100644 --- a/profiles/i3.py +++ b/profiles/i3.py @@ -18,12 +18,20 @@ def _prep_function(*args, **kwargs): supported_configurations = ['i3-wm', 'i3-gaps'] desktop = archinstall.generic_select(supported_configurations, 'Select your desired configuration: ') - + # 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['_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) # 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: -- cgit v1.2.3-70-g09d2 From 437315669f5fe38f90abb8d6f4da9ea60b9f6c12 Mon Sep 17 00:00:00 2001 From: Alexander Seiler Date: Fri, 9 Apr 2021 05:00:43 +0200 Subject: Fix typo that causes crash when creating encrypted LUKS partition (closes #248) --- archinstall/lib/luks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/archinstall/lib/luks.py b/archinstall/lib/luks.py index b076ac9b..561d4d6e 100644 --- a/archinstall/lib/luks.py +++ b/archinstall/lib/luks.py @@ -127,7 +127,7 @@ class luks2(): os.path.basename(mountpoint) # TODO: Raise exception instead? wait_timer = time.time() - while pathlib.Paht(partition.path).exists() is False and time.time() - wait_timer < 10: + while pathlib.Path(partition.path).exists() is False and time.time() - wait_timer < 10: time.sleep(0.025) sys_command(f'/usr/bin/cryptsetup open {partition.path} {mountpoint} --key-file {os.path.abspath(key_file)} --type luks2') -- cgit v1.2.3-70-g09d2 From acc2dac6527b5f7553a7066f80cc0680d328d31e Mon Sep 17 00:00:00 2001 From: Insanemal Date: Fri, 9 Apr 2021 13:44:51 +1000 Subject: Off by one in generic_selection out of bounds check Out of bounds check in generic_selection is using >= on list. Lists are zero based. If you put in a value that equals the number of items in the list you get an out of bounds error. Removed the equals part of the test as last item in list/dictionary items is len(list)-1 not len(list) --- archinstall/lib/user_interaction.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/archinstall/lib/user_interaction.py b/archinstall/lib/user_interaction.py index 3830962c..f8585595 100644 --- a/archinstall/lib/user_interaction.py +++ b/archinstall/lib/user_interaction.py @@ -184,7 +184,7 @@ def generic_select(options, input_text="Select one of the above by index or abso return None elif selected_option.isdigit(): selected_option = int(selected_option) - if selected_option >= len(options): + if selected_option > len(options): raise RequirementError(f'Selected option "{selected_option}" is out of range') selected_option = options[selected_option] elif selected_option in options: -- cgit v1.2.3-70-g09d2 From d50b26498e46327d71e57d133c323a4f58ba1180 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Fri, 9 Apr 2021 06:48:23 -0400 Subject: Add the sway packages from advaithm's 2.2.0 sway work Remove sddm --- profiles/applications/sway.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/profiles/applications/sway.py b/profiles/applications/sway.py index 5f66233c..c99f378a 100644 --- a/profiles/applications/sway.py +++ b/profiles/applications/sway.py @@ -1,3 +1,3 @@ import archinstall - -installation.add_additional_packages("sway sddm") +packages = "sway swaylock swayidle dmenu alacritty" +installation.add_additional_packages(packages) -- cgit v1.2.3-70-g09d2 From 02f4392c2250ba23174f4b53538994ae59803fa3 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Fri, 9 Apr 2021 06:38:49 -0400 Subject: As pointed out to me, sway doesn't officially support display managers --- profiles/sway.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/profiles/sway.py b/profiles/sway.py index fd8407df..5633cce2 100644 --- a/profiles/sway.py +++ b/profiles/sway.py @@ -20,5 +20,3 @@ if __name__ == 'sway': # Install the application sway from the template under /applications/ sway = archinstall.Application(installation, 'sway') sway.install() - - installation.enable_service('sddm') # SDDM, which supports Sway -- cgit v1.2.3-70-g09d2