From a4a7a33b5e68beba63e547a446015af10b8ce592 Mon Sep 17 00:00:00 2001 From: Anton Hvornum Date: Sat, 29 Jul 2023 12:37:50 +0200 Subject: [PATCH 1/8] Added back xinit for awesome, since it can be used without a greeter, as well as other useful tools we've had in previous releases --- archinstall/default_profiles/desktops/awesome.py | 11 ++++++++++- archinstall/default_profiles/xorg.py | 6 ++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/archinstall/default_profiles/desktops/awesome.py b/archinstall/default_profiles/desktops/awesome.py index 371e51dbef..e8d87a9eb2 100644 --- a/archinstall/default_profiles/desktops/awesome.py +++ b/archinstall/default_profiles/desktops/awesome.py @@ -16,7 +16,16 @@ def __init__(self): def packages(self) -> List[str]: return [ 'awesome', - 'alacritty' + 'alacritty', + 'xorg-xinit', + 'xorg-xrandr', + 'xterm', + 'feh', + 'slock', + 'terminus-font', + 'gnu-free-fonts', + 'ttf-liberation', + 'xsel', ] def preview_text(self) -> Optional[str]: diff --git a/archinstall/default_profiles/xorg.py b/archinstall/default_profiles/xorg.py index 553421a415..c3ce3a6b9e 100644 --- a/archinstall/default_profiles/xorg.py +++ b/archinstall/default_profiles/xorg.py @@ -19,3 +19,9 @@ def __init__( description=description, support_gfx_driver=True ) + + @property + def packages(self) -> List[str]: + return [ + 'xorg-xserver' + ] From 89987d1f2934ebf399ab20f5de24753334e4435e Mon Sep 17 00:00:00 2001 From: Anton Hvornum Date: Sat, 29 Jul 2023 12:40:04 +0200 Subject: [PATCH 2/8] flake8 fix --- archinstall/default_profiles/xorg.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/archinstall/default_profiles/xorg.py b/archinstall/default_profiles/xorg.py index c3ce3a6b9e..2a063dc234 100644 --- a/archinstall/default_profiles/xorg.py +++ b/archinstall/default_profiles/xorg.py @@ -1,4 +1,4 @@ -from typing import Any, TYPE_CHECKING +from typing import Any, TYPE_CHECKING, List from archinstall.default_profiles.profile import Profile, ProfileType From 44e9e99cfa5fd41cf5a1183e99ba4364bb0fc5ac Mon Sep 17 00:00:00 2001 From: Anton Hvornum Date: Sat, 29 Jul 2023 21:35:25 +0200 Subject: [PATCH 3/8] Fixing xinitrc for awesome profile --- .../default_profiles/desktops/awesome.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/archinstall/default_profiles/desktops/awesome.py b/archinstall/default_profiles/desktops/awesome.py index e8d87a9eb2..70089c3654 100644 --- a/archinstall/default_profiles/desktops/awesome.py +++ b/archinstall/default_profiles/desktops/awesome.py @@ -46,3 +46,22 @@ def install(self, install_session: 'Installer'): fh.write(awesome_lua) # TODO: Configure the right-click-menu to contain the above packages that were installed. (as a user config) + + # TODO: check if we selected a greeter, + # but for now, awesome is intended to run without one. + with open(f"{install_session.target}/etc/X11/xinit/xinitrc", 'r') as xinitrc: + xinitrc_data = xinitrc.read() + + for line in xinitrc_data.split('\n'): + if "twm &" in line: + xinitrc_data = xinitrc_data.replace(line, f"# {line}") + if "xclock" in line: + xinitrc_data = xinitrc_data.replace(line, f"# {line}") + if "xterm" in line: + xinitrc_data = xinitrc_data.replace(line, f"# {line}") + + xinitrc_data += '\n' + xinitrc_data += 'exec awesome\n' + + with open(f"{install_session.target}/etc/X11/xinit/xinitrc", 'w') as xinitrc: + xinitrc.write(xinitrc_data) \ No newline at end of file From 10030f7adf54617cabc9c533b5455a98fdf8b5b4 Mon Sep 17 00:00:00 2001 From: Anton Hvornum Date: Sat, 29 Jul 2023 21:51:40 +0200 Subject: [PATCH 4/8] Attempting to grab xorg packages when installing the desktop profile --- archinstall/default_profiles/desktops/awesome.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/archinstall/default_profiles/desktops/awesome.py b/archinstall/default_profiles/desktops/awesome.py index 70089c3654..79e0eb7115 100644 --- a/archinstall/default_profiles/desktops/awesome.py +++ b/archinstall/default_profiles/desktops/awesome.py @@ -14,7 +14,7 @@ def __init__(self): @property def packages(self) -> List[str]: - return [ + return super().packages + [ 'awesome', 'alacritty', 'xorg-xinit', From 861c4022fdf65a42418a0871e2054dcde5d5bd3f Mon Sep 17 00:00:00 2001 From: Anton Hvornum Date: Sat, 29 Jul 2023 22:02:41 +0200 Subject: [PATCH 5/8] Spelling error on xorg-server --- archinstall/default_profiles/xorg.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/archinstall/default_profiles/xorg.py b/archinstall/default_profiles/xorg.py index 2a063dc234..131548187d 100644 --- a/archinstall/default_profiles/xorg.py +++ b/archinstall/default_profiles/xorg.py @@ -23,5 +23,5 @@ def __init__( @property def packages(self) -> List[str]: return [ - 'xorg-xserver' + 'xorg-server' ] From 9cb59f86f378b8d22c44b3e4e015a0e8ec1ee2de Mon Sep 17 00:00:00 2001 From: Anton Hvornum Date: Sat, 29 Jul 2023 23:35:00 +0200 Subject: [PATCH 6/8] Fixed sway value error on seat selection --- .../default_profiles/desktops/bspwm.py | 22 +++++++++++++++++++ archinstall/default_profiles/desktops/sway.py | 2 +- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/archinstall/default_profiles/desktops/bspwm.py b/archinstall/default_profiles/desktops/bspwm.py index f3bc982d78..2a29f41b6c 100644 --- a/archinstall/default_profiles/desktops/bspwm.py +++ b/archinstall/default_profiles/desktops/bspwm.py @@ -13,6 +13,7 @@ def __init__(self): @property def packages(self) -> List[str]: + # return super().packages + [ return [ 'bspwm', 'sxhkd', @@ -28,3 +29,24 @@ def default_greeter_type(self) -> Optional[GreeterType]: def preview_text(self) -> Optional[str]: text = str(_('Environment type: {}')).format(self.profile_type.value) return text + '\n' + self.packages_text() + + # The wiki specified xinit, but we already use greeter? + # https://wiki.archlinux.org/title/Bspwm#Starting + # + # # TODO: check if we selected a greeter, else run this: + # with open(f"{install_session.target}/etc/X11/xinit/xinitrc", 'r') as xinitrc: + # xinitrc_data = xinitrc.read() + + # for line in xinitrc_data.split('\n'): + # if "twm &" in line: + # xinitrc_data = xinitrc_data.replace(line, f"# {line}") + # if "xclock" in line: + # xinitrc_data = xinitrc_data.replace(line, f"# {line}") + # if "xterm" in line: + # xinitrc_data = xinitrc_data.replace(line, f"# {line}") + + # xinitrc_data += '\n' + # xinitrc_data += 'exec bspwn\n' + + # with open(f"{install_session.target}/etc/X11/xinit/xinitrc", 'w') as xinitrc: + # xinitrc.write(xinitrc_data) diff --git a/archinstall/default_profiles/desktops/sway.py b/archinstall/default_profiles/desktops/sway.py index ae814e46b5..25d74a88a5 100644 --- a/archinstall/default_profiles/desktops/sway.py +++ b/archinstall/default_profiles/desktops/sway.py @@ -53,7 +53,7 @@ def default_greeter_type(self) -> Optional[GreeterType]: @property def services(self) -> List[str]: if pref := self.custom_settings.get('seat_access', None): - return [pref.value] + return [pref] return [] def _ask_seat_access(self): From 304afa0fc5504eb5446bb721bd144a7bfc174203 Mon Sep 17 00:00:00 2001 From: Anton Hvornum Date: Sun, 30 Jul 2023 00:25:31 +0200 Subject: [PATCH 7/8] Flake8 fixes --- archinstall/__init__.py | 4 ++-- archinstall/lib/general.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/archinstall/__init__.py b/archinstall/__init__.py index cfaecd160c..56f0b278c9 100644 --- a/archinstall/__init__.py +++ b/archinstall/__init__.py @@ -145,12 +145,12 @@ def cleanup_empty_args(args: Union[Namespace, Dict]) -> Dict: Takes arguments (dictionary or argparse Namespace) and removes any None values. This ensures clean mergers during dict.update(args) """ - if type(args) == Namespace: + if type(args) is Namespace: args = vars(args) clean_args = {} for key, val in args.items(): - if type(val) == dict: + if isinstance(val, dict): val = cleanup_empty_args(val) if val is not None: diff --git a/archinstall/lib/general.py b/archinstall/lib/general.py index 473f85a4a8..5bce4b04da 100644 --- a/archinstall/lib/general.py +++ b/archinstall/lib/general.py @@ -211,7 +211,7 @@ def is_alive(self) -> bool: return False def write(self, data: bytes, line_ending :bool = True) -> int: - assert type(data) == bytes # TODO: Maybe we can support str as well and encode it + assert isinstance(data, bytes): # TODO: Maybe we can support str as well and encode it self.make_sure_we_are_executing() From 9579e93d0c3d0184f48a975f9044f415d73d7f8d Mon Sep 17 00:00:00 2001 From: Anton Hvornum Date: Sun, 30 Jul 2023 00:26:39 +0200 Subject: [PATCH 8/8] Flake8 fixes --- archinstall/lib/general.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/archinstall/lib/general.py b/archinstall/lib/general.py index 5bce4b04da..90af25ed9b 100644 --- a/archinstall/lib/general.py +++ b/archinstall/lib/general.py @@ -211,7 +211,7 @@ def is_alive(self) -> bool: return False def write(self, data: bytes, line_ending :bool = True) -> int: - assert isinstance(data, bytes): # TODO: Maybe we can support str as well and encode it + assert isinstance(data, bytes) # TODO: Maybe we can support str as well and encode it self.make_sure_we_are_executing()