From 00b0ae7ba439a5a420095175b3bedd52c569db51 Mon Sep 17 00:00:00 2001 From: Daniel Girtler Date: Wed, 19 Apr 2023 20:55:42 +1000 Subject: PyParted and a large rewrite of the underlying partitioning (#1604) * Invert mypy files * Add optional pre-commit hooks * New profile structure * Serialize profiles * Use profile instead of classmethod * Custom profile setup * Separator between back * Support profile import via url * Move profiles module * Refactor files * Remove symlink * Add user to docker group * Update schema description * Handle list services * mypy fixes * mypy fixes * Rename profilesv2 to profiles * flake8 * mypy again * Support selecting DM * Fix mypy * Cleanup * Update greeter setting * Update schema * Revert toml changes * Poc external dependencies * Dependency support * New encryption menu * flake8 * Mypy and flake8 * Unify lsblk command * Update bootloader configuration * Git hooks * Fix import * Pyparted * Remove custom font setting * flake8 * Remove default preview * Manual partitioning menu * Update structure * Disk configuration * Update filesystem * luks2 encryption * Everything works until installation * Btrfsutil * Btrfs handling * Update btrfs * Save encryption config * Fix pipewire issue * Update mypy version * Update all pre-commit * Update package versions * Revert audio/pipewire * Merge master PRs * Add master changes * Merge master changes * Small renaming * Pull master changes * Reset disk enc after disk config change * Generate locals * Update naming * Fix imports * Fix broken sync * Fix pre selection on table menu * Profile menu * Update profile * Fix post_install * Added python-pyparted to PKGBUILD, this requires [testing] to be enabled in order to run makepkg. Package still works via python -m build etc. * Swaped around some setuptools logic in pyproject Since we define `package-data` and `packages` there should be no need for: ``` [tool.setuptools.packages.find] where = ["archinstall", "archinstall.*"] ``` * Removed pyproject collisions. Duplicate definitions. * Made sure pyproject.toml includes languages * Add example and update README * Fix pyproject issues * Generate locale * Refactor imports * Simplify imports * Add profile description and package examples * Align code * Fix mypy * Simplify imports * Fix saving config * Fix wrong luks merge * Refactor installation * Fix cdrom device loading * Fix wrongly merged code * Fix imports and greeter * Don't terminate on partprobe error * Use specific path on partprobe from luks * Update archinstall/lib/disk/device_model.py Co-authored-by: codefiles <11915375+codefiles@users.noreply.github.com> * Update archinstall/lib/disk/device_model.py Co-authored-by: codefiles <11915375+codefiles@users.noreply.github.com> * Update github workflow to test archinstall installation * Update sway merge * Generate locales * Update workflow --------- Co-authored-by: Daniel Girtler Co-authored-by: Anton Hvornum Co-authored-by: Anton Hvornum Co-authored-by: codefiles <11915375+codefiles@users.noreply.github.com> --- archinstall/default_profiles/desktops/sway.py | 66 +++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 archinstall/default_profiles/desktops/sway.py (limited to 'archinstall/default_profiles/desktops/sway.py') diff --git a/archinstall/default_profiles/desktops/sway.py b/archinstall/default_profiles/desktops/sway.py new file mode 100644 index 00000000..519f5bbb --- /dev/null +++ b/archinstall/default_profiles/desktops/sway.py @@ -0,0 +1,66 @@ +from typing import List, Optional, TYPE_CHECKING, Any + +from archinstall.default_profiles.profile import ProfileType, GreeterType +from archinstall.default_profiles.xorg import XorgProfile +from archinstall.lib.menu import Menu + +if TYPE_CHECKING: + from archinstall.lib.installer import Installer + _: Any + + +class SwayProfile(XorgProfile): + def __init__(self): + super().__init__( + 'Sway', + ProfileType.WindowMgr, + description='' + ) + self._control_preference = [] + + @property + def packages(self) -> List[str]: + return [ + "sway", + "swaybg", + "swaylock", + "swayidle", + "waybar", + "dmenu", + "brightnessctl", + "grim", + "slurp", + "pavucontrol", + "foot", + "xorg-xwayland" + ] + self._control_preference + + @property + def default_greeter_type(self) -> Optional[GreeterType]: + return GreeterType.Lightdm + + @property + def services(self) -> List[str]: + if "seatd" in self._control_preference: + return ['seatd'] + elif "polkit" in self._control_preference: + return ['polkit'] + + return [] + + def _get_system_privelege_control_preference(self): + # need to activate seat service and add to seat group + title = str(_('Sway needs access to your seat (collection of hardware devices i.e. keyboard, mouse, etc)')) + title += str(_('\n\nChoose an option to give Sway access to your hardware')) + choice = Menu(title, ["polkit", "seatd"], skip=False).run() + self._control_preference = [choice.value] + + def do_on_select(self): + self._get_system_privelege_control_preference() + + def preview_text(self) -> Optional[str]: + text = str(_('Environment type: {}')).format(self.profile_type.value) + return text + '\n' + self.packages_text() + + def install(self, install_session: 'Installer'): + super().install(install_session) -- cgit v1.2.3-54-g00ecf From 235c1190b003b8f69ff344d6e2ac31f4bd1d0ba2 Mon Sep 17 00:00:00 2001 From: Daniel Girtler Date: Sat, 6 May 2023 16:09:58 +1000 Subject: Fix 1763 (#1790) * Fix 1763 --------- Co-authored-by: Daniel Girtler --- archinstall/default_profiles/desktops/sway.py | 37 +++++++++++++++++++-------- archinstall/default_profiles/profile.py | 25 ++++++++---------- archinstall/lib/profile/profiles_handler.py | 8 ++++++ 3 files changed, 44 insertions(+), 26 deletions(-) (limited to 'archinstall/default_profiles/desktops/sway.py') diff --git a/archinstall/default_profiles/desktops/sway.py b/archinstall/default_profiles/desktops/sway.py index 519f5bbb..ae814e46 100644 --- a/archinstall/default_profiles/desktops/sway.py +++ b/archinstall/default_profiles/desktops/sway.py @@ -1,3 +1,4 @@ +from enum import Enum from typing import List, Optional, TYPE_CHECKING, Any from archinstall.default_profiles.profile import ProfileType, GreeterType @@ -9,6 +10,11 @@ if TYPE_CHECKING: _: Any +class SeatAccess(Enum): + seatd = 'seatd' + polkit = 'polkit' + + class SwayProfile(XorgProfile): def __init__(self): super().__init__( @@ -16,10 +22,15 @@ class SwayProfile(XorgProfile): ProfileType.WindowMgr, description='' ) - self._control_preference = [] + + self.custom_settings = {'seat_access': None} @property def packages(self) -> List[str]: + additional = [] + if seat := self.custom_settings.get('seat_access', None): + additional = [seat] + return [ "sway", "swaybg", @@ -33,7 +44,7 @@ class SwayProfile(XorgProfile): "pavucontrol", "foot", "xorg-xwayland" - ] + self._control_preference + ] + additional @property def default_greeter_type(self) -> Optional[GreeterType]: @@ -41,22 +52,26 @@ class SwayProfile(XorgProfile): @property def services(self) -> List[str]: - if "seatd" in self._control_preference: - return ['seatd'] - elif "polkit" in self._control_preference: - return ['polkit'] - + if pref := self.custom_settings.get('seat_access', None): + return [pref.value] return [] - def _get_system_privelege_control_preference(self): + def _ask_seat_access(self): # need to activate seat service and add to seat group title = str(_('Sway needs access to your seat (collection of hardware devices i.e. keyboard, mouse, etc)')) title += str(_('\n\nChoose an option to give Sway access to your hardware')) - choice = Menu(title, ["polkit", "seatd"], skip=False).run() - self._control_preference = [choice.value] + + options = [e.value for e in SeatAccess] + default = None + + if seat := self.custom_settings.get('seat_access', None): + default = seat + + choice = Menu(title, options, skip=False, preset_values=default).run() + self.custom_settings['seat_access'] = choice.single_value def do_on_select(self): - self._get_system_privelege_control_preference() + self._ask_seat_access() def preview_text(self) -> Optional[str]: text = str(_('Environment type: {}')).format(self.profile_type.value) diff --git a/archinstall/default_profiles/profile.py b/archinstall/default_profiles/profile.py index c7d6b3dc..b1ad1f50 100644 --- a/archinstall/default_profiles/profile.py +++ b/archinstall/default_profiles/profile.py @@ -1,6 +1,5 @@ from __future__ import annotations -from dataclasses import dataclass from enum import Enum, auto from typing import List, Optional, Any, Dict, TYPE_CHECKING, TypeVar @@ -43,20 +42,6 @@ class SelectResult(Enum): ResetCurrent = auto() -@dataclass -class ProfileInfo: - name: str - details: Optional[str] - gfx_driver: Optional[str] = None - greeter: Optional[str] = None - - @property - def absolute_name(self) -> str: - if self.details is not None: - return self.details - return self.name - - class Profile: def __init__( self, @@ -72,6 +57,8 @@ class Profile: self.name = name self.description = description self.profile_type = profile_type + self.custom_settings: Dict[str, Any] = {} + self._support_gfx_driver = support_gfx_driver self._support_greeter = support_greeter @@ -135,6 +122,14 @@ class Profile: """ return SelectResult.NewSelection + def set_custom_settings(self, settings: Dict[str, Any]): + """ + Set the custom settings for the profile. + This is also called when the settings are parsed from the config + and can be overriden to perform further actions based on the profile + """ + self.custom_settings = settings + def current_selection_names(self) -> List[str]: if self._current_selection: return [s.name for s in self._current_selection] diff --git a/archinstall/lib/profile/profiles_handler.py b/archinstall/lib/profile/profiles_handler.py index 824849c3..6ed95f8e 100644 --- a/archinstall/lib/profile/profiles_handler.py +++ b/archinstall/lib/profile/profiles_handler.py @@ -43,6 +43,7 @@ class ProfileHandler: data = { 'main': profile.name, 'details': [profile.name for profile in profile.current_selection], + 'custom_settings': {profile.name: profile.custom_settings for profile in profile.current_selection} } if self._url_path is not None: @@ -98,6 +99,7 @@ class ProfileHandler: profile = self.get_profile_by_name(main) if main else None valid: List[Profile] = [] + if details := profile_config.get('details', []): resolved = {detail: self.get_profile_by_name(detail) for detail in details if detail} valid = [p for p in resolved.values() if p is not None] @@ -106,6 +108,12 @@ class ProfileHandler: if invalid: log(f'No profile definition found: {invalid}') + custom_settings = profile_config.get('custom_settings', {}) + for profile in valid: + profile.set_custom_settings( + custom_settings.get(profile.name, {}) + ) + if profile is not None: profile.set_current_selection(valid) -- cgit v1.2.3-54-g00ecf From a43344c5ae2249ddb70e535637915b30563c5038 Mon Sep 17 00:00:00 2001 From: Anton Hvornum Date: Sun, 30 Jul 2023 00:28:21 +0200 Subject: Adding pack packages to profiles after they were removed (#1956) * 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 * Fixing xinitrc for awesome profile * Attempting to grab xorg packages when installing the desktop profile * Spelling error on xorg-server * Fixed sway value error on seat selection --- archinstall/__init__.py | 4 +-- archinstall/default_profiles/desktops/awesome.py | 32 ++++++++++++++++++++++-- archinstall/default_profiles/desktops/bspwm.py | 22 ++++++++++++++++ archinstall/default_profiles/desktops/sway.py | 2 +- archinstall/default_profiles/xorg.py | 8 +++++- archinstall/lib/general.py | 2 +- 6 files changed, 63 insertions(+), 7 deletions(-) (limited to 'archinstall/default_profiles/desktops/sway.py') diff --git a/archinstall/__init__.py b/archinstall/__init__.py index cfaecd16..56f0b278 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/default_profiles/desktops/awesome.py b/archinstall/default_profiles/desktops/awesome.py index 371e51db..79e0eb71 100644 --- a/archinstall/default_profiles/desktops/awesome.py +++ b/archinstall/default_profiles/desktops/awesome.py @@ -14,9 +14,18 @@ class AwesomeProfile(XorgProfile): @property def packages(self) -> List[str]: - return [ + return super().packages + [ 'awesome', - 'alacritty' + 'alacritty', + 'xorg-xinit', + 'xorg-xrandr', + 'xterm', + 'feh', + 'slock', + 'terminus-font', + 'gnu-free-fonts', + 'ttf-liberation', + 'xsel', ] def preview_text(self) -> Optional[str]: @@ -37,3 +46,22 @@ class AwesomeProfile(XorgProfile): 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 diff --git a/archinstall/default_profiles/desktops/bspwm.py b/archinstall/default_profiles/desktops/bspwm.py index f3bc982d..2a29f41b 100644 --- a/archinstall/default_profiles/desktops/bspwm.py +++ b/archinstall/default_profiles/desktops/bspwm.py @@ -13,6 +13,7 @@ class BspwmProfile(XorgProfile): @property def packages(self) -> List[str]: + # return super().packages + [ return [ 'bspwm', 'sxhkd', @@ -28,3 +29,24 @@ class BspwmProfile(XorgProfile): 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 ae814e46..25d74a88 100644 --- a/archinstall/default_profiles/desktops/sway.py +++ b/archinstall/default_profiles/desktops/sway.py @@ -53,7 +53,7 @@ class SwayProfile(XorgProfile): @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): diff --git a/archinstall/default_profiles/xorg.py b/archinstall/default_profiles/xorg.py index 553421a4..13154818 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 @@ -19,3 +19,9 @@ class XorgProfile(Profile): description=description, support_gfx_driver=True ) + + @property + def packages(self) -> List[str]: + return [ + 'xorg-server' + ] diff --git a/archinstall/lib/general.py b/archinstall/lib/general.py index 473f85a4..90af25ed 100644 --- a/archinstall/lib/general.py +++ b/archinstall/lib/general.py @@ -211,7 +211,7 @@ class SysCommandWorker: 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() -- cgit v1.2.3-54-g00ecf From f8d269092033f49b9f9621580fa1862e0c3b6cdb Mon Sep 17 00:00:00 2001 From: Himadri Bhattacharjee <107522312+lavafroth@users.noreply.github.com> Date: Mon, 31 Jul 2023 07:40:45 +0000 Subject: move preview text method for profiles into xorg superclass, override when needed (#1918) Co-authored-by: Anton Hvornum --- archinstall/default_profiles/desktops/awesome.py | 6 +----- archinstall/default_profiles/desktops/budgie.py | 4 ---- archinstall/default_profiles/desktops/cinnamon.py | 4 ---- archinstall/default_profiles/desktops/cutefish.py | 4 ---- archinstall/default_profiles/desktops/deepin.py | 4 ---- archinstall/default_profiles/desktops/enlightenment.py | 4 ---- archinstall/default_profiles/desktops/gnome.py | 4 ---- archinstall/default_profiles/desktops/hyperland.py | 4 ---- archinstall/default_profiles/desktops/i3.py | 4 ---- archinstall/default_profiles/desktops/kde.py | 4 ---- archinstall/default_profiles/desktops/lxqt.py | 4 ---- archinstall/default_profiles/desktops/mate.py | 4 ---- archinstall/default_profiles/desktops/qtile.py | 4 ---- archinstall/default_profiles/desktops/sway.py | 4 ---- archinstall/default_profiles/desktops/xfce4.py | 4 ---- archinstall/default_profiles/xorg.py | 6 +++++- 16 files changed, 6 insertions(+), 62 deletions(-) (limited to 'archinstall/default_profiles/desktops/sway.py') diff --git a/archinstall/default_profiles/desktops/awesome.py b/archinstall/default_profiles/desktops/awesome.py index 79e0eb71..3833ce71 100644 --- a/archinstall/default_profiles/desktops/awesome.py +++ b/archinstall/default_profiles/desktops/awesome.py @@ -1,4 +1,4 @@ -from typing import List, Optional, Any, TYPE_CHECKING +from typing import List, Any, TYPE_CHECKING from archinstall.default_profiles.profile import ProfileType from archinstall.default_profiles.xorg import XorgProfile @@ -28,10 +28,6 @@ class AwesomeProfile(XorgProfile): 'xsel', ] - def preview_text(self) -> Optional[str]: - text = str(_('Environment type: {}')).format(self.profile_type.value) - return text + '\n' + self.packages_text() - def install(self, install_session: 'Installer'): super().install(install_session) diff --git a/archinstall/default_profiles/desktops/budgie.py b/archinstall/default_profiles/desktops/budgie.py index 93be320f..68506d45 100644 --- a/archinstall/default_profiles/desktops/budgie.py +++ b/archinstall/default_profiles/desktops/budgie.py @@ -24,7 +24,3 @@ class BudgieProfile(XorgProfile): @property def default_greeter_type(self) -> Optional[GreeterType]: return GreeterType.Lightdm - - def preview_text(self) -> Optional[str]: - text = str(_('Environment type: {}')).format(self.profile_type.value) - return text + '\n' + self.packages_text() diff --git a/archinstall/default_profiles/desktops/cinnamon.py b/archinstall/default_profiles/desktops/cinnamon.py index 22fd0d9d..a819b4d1 100644 --- a/archinstall/default_profiles/desktops/cinnamon.py +++ b/archinstall/default_profiles/desktops/cinnamon.py @@ -25,7 +25,3 @@ class CinnamonProfile(XorgProfile): @property def default_greeter_type(self) -> Optional[GreeterType]: return GreeterType.Lightdm - - def preview_text(self) -> Optional[str]: - text = str(_('Environment type: {}')).format(self.profile_type.value) - return text + '\n' + self.packages_text() diff --git a/archinstall/default_profiles/desktops/cutefish.py b/archinstall/default_profiles/desktops/cutefish.py index 6f88c47a..c4202920 100644 --- a/archinstall/default_profiles/desktops/cutefish.py +++ b/archinstall/default_profiles/desktops/cutefish.py @@ -23,9 +23,5 @@ class CutefishProfile(XorgProfile): def default_greeter_type(self) -> Optional[GreeterType]: return GreeterType.Sddm - def preview_text(self) -> Optional[str]: - text = str(_('Environment type: {}')).format(self.profile_type.value) - return text + '\n' + self.packages_text() - def install(self, install_session: 'Installer'): super().install(install_session) diff --git a/archinstall/default_profiles/desktops/deepin.py b/archinstall/default_profiles/desktops/deepin.py index 054c8fdf..e6a9f6b5 100644 --- a/archinstall/default_profiles/desktops/deepin.py +++ b/archinstall/default_profiles/desktops/deepin.py @@ -22,7 +22,3 @@ class DeepinProfile(XorgProfile): @property def default_greeter_type(self) -> Optional[GreeterType]: return GreeterType.Lightdm - - def preview_text(self) -> Optional[str]: - text = str(_('Environment type: {}')).format(self.profile_type.value) - return text + '\n' + self.packages_text() diff --git a/archinstall/default_profiles/desktops/enlightenment.py b/archinstall/default_profiles/desktops/enlightenment.py index 164f64fe..7dd7822a 100644 --- a/archinstall/default_profiles/desktops/enlightenment.py +++ b/archinstall/default_profiles/desktops/enlightenment.py @@ -21,7 +21,3 @@ class EnlighenmentProfile(XorgProfile): @property def default_greeter_type(self) -> Optional[GreeterType]: return GreeterType.Lightdm - - def preview_text(self) -> Optional[str]: - text = str(_('Environment type: {}')).format(self.profile_type.value) - return text + '\n' + self.packages_text() diff --git a/archinstall/default_profiles/desktops/gnome.py b/archinstall/default_profiles/desktops/gnome.py index 3cbd49bd..24ade437 100644 --- a/archinstall/default_profiles/desktops/gnome.py +++ b/archinstall/default_profiles/desktops/gnome.py @@ -21,7 +21,3 @@ class GnomeProfile(XorgProfile): @property def default_greeter_type(self) -> Optional[GreeterType]: return GreeterType.Gdm - - def preview_text(self) -> Optional[str]: - text = str(_('Environment type: {}')).format(self.profile_type.value) - return text + '\n' + self.packages_text() diff --git a/archinstall/default_profiles/desktops/hyperland.py b/archinstall/default_profiles/desktops/hyperland.py index e55dd7c4..58ee8cca 100644 --- a/archinstall/default_profiles/desktops/hyperland.py +++ b/archinstall/default_profiles/desktops/hyperland.py @@ -25,7 +25,3 @@ class HyperlandProfile(XorgProfile): @property def default_greeter_type(self) -> Optional[GreeterType]: return GreeterType.Sddm - - def preview_text(self) -> Optional[str]: - text = str(_('Environment type: {}')).format(self.profile_type.value) - return text + '\n' + self.packages_text() diff --git a/archinstall/default_profiles/desktops/i3.py b/archinstall/default_profiles/desktops/i3.py index 93c38906..9c2994de 100644 --- a/archinstall/default_profiles/desktops/i3.py +++ b/archinstall/default_profiles/desktops/i3.py @@ -27,7 +27,3 @@ class I3wmProfile(XorgProfile): @property def default_greeter_type(self) -> Optional[GreeterType]: return GreeterType.Lightdm - - def preview_text(self) -> Optional[str]: - text = str(_('Environment type: {}')).format(self.profile_type.value) - return text + '\n' + self.packages_text() diff --git a/archinstall/default_profiles/desktops/kde.py b/archinstall/default_profiles/desktops/kde.py index cd02e069..b65a9620 100644 --- a/archinstall/default_profiles/desktops/kde.py +++ b/archinstall/default_profiles/desktops/kde.py @@ -26,7 +26,3 @@ class KdeProfile(XorgProfile): @property def default_greeter_type(self) -> Optional[GreeterType]: return GreeterType.Sddm - - def preview_text(self) -> Optional[str]: - text = str(_('Environment type: {}')).format(self.profile_type.value) - return text + '\n' + self.packages_text() diff --git a/archinstall/default_profiles/desktops/lxqt.py b/archinstall/default_profiles/desktops/lxqt.py index 60bf47f2..5d75e08d 100644 --- a/archinstall/default_profiles/desktops/lxqt.py +++ b/archinstall/default_profiles/desktops/lxqt.py @@ -29,7 +29,3 @@ class LxqtProfile(XorgProfile): @property def default_greeter_type(self) -> Optional[GreeterType]: return GreeterType.Sddm - - def preview_text(self) -> Optional[str]: - text = str(_('Environment type: {}')).format(self.profile_type.value) - return text + '\n' + self.packages_text() diff --git a/archinstall/default_profiles/desktops/mate.py b/archinstall/default_profiles/desktops/mate.py index 0ddaaaab..d3c4a6e1 100644 --- a/archinstall/default_profiles/desktops/mate.py +++ b/archinstall/default_profiles/desktops/mate.py @@ -21,7 +21,3 @@ class MateProfile(XorgProfile): @property def default_greeter_type(self) -> Optional[GreeterType]: return GreeterType.Lightdm - - def preview_text(self) -> Optional[str]: - text = str(_('Environment type: {}')).format(self.profile_type.value) - return text + '\n' + self.packages_text() diff --git a/archinstall/default_profiles/desktops/qtile.py b/archinstall/default_profiles/desktops/qtile.py index 66c6fa1b..96e93b1d 100644 --- a/archinstall/default_profiles/desktops/qtile.py +++ b/archinstall/default_profiles/desktops/qtile.py @@ -21,7 +21,3 @@ class QtileProfile(XorgProfile): @property def default_greeter_type(self) -> Optional[GreeterType]: return GreeterType.Lightdm - - def preview_text(self) -> Optional[str]: - text = str(_('Environment type: {}')).format(self.profile_type.value) - return text + '\n' + self.packages_text() diff --git a/archinstall/default_profiles/desktops/sway.py b/archinstall/default_profiles/desktops/sway.py index 25d74a88..c757797d 100644 --- a/archinstall/default_profiles/desktops/sway.py +++ b/archinstall/default_profiles/desktops/sway.py @@ -73,9 +73,5 @@ class SwayProfile(XorgProfile): def do_on_select(self): self._ask_seat_access() - def preview_text(self) -> Optional[str]: - text = str(_('Environment type: {}')).format(self.profile_type.value) - return text + '\n' + self.packages_text() - def install(self, install_session: 'Installer'): super().install(install_session) diff --git a/archinstall/default_profiles/desktops/xfce4.py b/archinstall/default_profiles/desktops/xfce4.py index bd6c3038..a7f0a7e6 100644 --- a/archinstall/default_profiles/desktops/xfce4.py +++ b/archinstall/default_profiles/desktops/xfce4.py @@ -24,7 +24,3 @@ class Xfce4Profile(XorgProfile): @property def default_greeter_type(self) -> Optional[GreeterType]: return GreeterType.Lightdm - - def preview_text(self) -> Optional[str]: - text = str(_('Environment type: {}')).format(self.profile_type.value) - return text + '\n' + self.packages_text() diff --git a/archinstall/default_profiles/xorg.py b/archinstall/default_profiles/xorg.py index 13154818..c9abf4da 100644 --- a/archinstall/default_profiles/xorg.py +++ b/archinstall/default_profiles/xorg.py @@ -1,4 +1,4 @@ -from typing import Any, TYPE_CHECKING, List +from typing import Any, Optional, TYPE_CHECKING, List from archinstall.default_profiles.profile import Profile, ProfileType @@ -20,6 +20,10 @@ class XorgProfile(Profile): support_gfx_driver=True ) + def preview_text(self) -> Optional[str]: + text = str(_('Environment type: {}')).format(self.profile_type.value) + return text + '\n' + self.packages_text() + @property def packages(self) -> List[str]: return [ -- cgit v1.2.3-54-g00ecf