Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--archinstall/lib/installer.py2
-rw-r--r--profiles/applications/sway.py3
-rw-r--r--profiles/awesome.py10
-rw-r--r--profiles/cinnamon.py34
-rw-r--r--profiles/desktop.py12
-rw-r--r--profiles/sway.py24
-rw-r--r--profiles/xfce4.py35
7 files changed, 109 insertions, 11 deletions
diff --git a/archinstall/lib/installer.py b/archinstall/lib/installer.py
index 66cac12c..b7fe5e9d 100644
--- a/archinstall/lib/installer.py
+++ b/archinstall/lib/installer.py
@@ -34,7 +34,7 @@ class Installer():
:type hostname: str, optional
"""
- def __init__(self, partition, boot_partition, *, base_packages='base base-devel linux linux-firmware efibootmgr nano', profile=None, mountpoint='/mnt', hostname='ArchInstalled', logdir=None, logfile=None):
+ def __init__(self, partition, boot_partition, *, base_packages='base base-devel linux linux-firmware efibootmgr', profile=None, mountpoint='/mnt', hostname='ArchInstalled', logdir=None, logfile=None):
self.profile = profile
self.hostname = hostname
self.mountpoint = mountpoint
diff --git a/profiles/applications/sway.py b/profiles/applications/sway.py
new file mode 100644
index 00000000..5f66233c
--- /dev/null
+++ b/profiles/applications/sway.py
@@ -0,0 +1,3 @@
+import archinstall
+
+installation.add_additional_packages("sway sddm")
diff --git a/profiles/awesome.py b/profiles/awesome.py
index c54aa827..0b00a424 100644
--- a/profiles/awesome.py
+++ b/profiles/awesome.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__ = ['nano', 'nemo', 'gpicview-gtk3', 'openssh', 'sshfs', 'htop', 'scrot', 'wget']
+__packages__ = ['nemo', 'gpicview-gtk3', 'scrot']
def _prep_function(*args, **kwargs):
"""
@@ -33,13 +33,7 @@ if __name__ == 'awesome':
awesome = archinstall.Application(installation, 'awesome')
awesome.install()
- # Then setup and configure the desktop environment: awesome
- editor = "nano"
- filebrowser = "nemo gpicview-gtk3"
- utils = "openssh sshfs htop scrot wget"
-
-
- installation.add_additional_packages(f"{utils} {filebrowser} {editor}")
+ installation.add_additional_packages(__packages__)
alacritty = archinstall.Application(installation, 'alacritty')
alacritty.install()
diff --git a/profiles/cinnamon.py b/profiles/cinnamon.py
new file mode 100644
index 00000000..91a59811
--- /dev/null
+++ b/profiles/cinnamon.py
@@ -0,0 +1,34 @@
+# A desktop environment using "Cinnamon"
+
+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.
+ """
+
+ # Cinnamon 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')
+
+# Ensures that this code only gets executed if executed
+# through importlib.util.spec_from_file_location("cinnamon", "/somewhere/cinnamon.py")
+# or through conventional import cinnamon
+if __name__ == 'cinnamon':
+ # Install dependency profiles
+ installation.install_profile('xorg')
+
+ # Install the application cinnamon from the template under /applications/
+ cinnamon = archinstall.Application(installation, 'cinnamon')
+ cinnamon.install()
+
+ installation.enable_service('lightdm') # Light Display Manager
diff --git a/profiles/desktop.py b/profiles/desktop.py
index e7536629..d552a17f 100644
--- a/profiles/desktop.py
+++ b/profiles/desktop.py
@@ -4,6 +4,10 @@ import archinstall, os
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']
+
def _prep_function(*args, **kwargs):
"""
Magic function called by the importing installer
@@ -12,9 +16,9 @@ def _prep_function(*args, **kwargs):
for more input before any other installer steps start.
"""
- supported_desktops = ['gnome', 'kde', 'awesome']
+ supported_desktops = ['gnome', 'kde', 'awesome', 'sway', 'cinnamon', 'xfce4']
desktop = archinstall.generic_select(supported_desktops, 'Select your desired desktop environment: ')
-
+
# Temporarily store the selected desktop profile
# in a session-safe location, since this module will get reloaded
# the next time it gets executed.
@@ -41,7 +45,11 @@ if __name__ == 'desktop':
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 desktop environments
+ 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'])
+
diff --git a/profiles/sway.py b/profiles/sway.py
new file mode 100644
index 00000000..fd8407df
--- /dev/null
+++ b/profiles/sway.py
@@ -0,0 +1,24 @@
+# A desktop environment using "Sway"
+
+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.
+ """
+ return True
+
+# Ensures that this code only gets executed if executed
+# through importlib.util.spec_from_file_location("sway", "/somewhere/sway.py")
+# or through conventional import sway
+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
diff --git a/profiles/xfce4.py b/profiles/xfce4.py
new file mode 100644
index 00000000..fee8c37a
--- /dev/null
+++ b/profiles/xfce4.py
@@ -0,0 +1,35 @@
+
+# A desktop environment using "Xfce4"
+
+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.
+ """
+
+ # XFCE 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("xfce4", "/somewhere/xfce4.py")
+# or through conventional import xfce4
+if __name__ == 'xfce4':
+ # Install dependency profiles
+ installation.install_profile('xorg')
+
+ # Install the application xfce4 from the template under /applications/
+ xfce = archinstall.Application(installation, 'xfce4')
+ xfce.install()
+
+ installation.enable_service('lightdm') # Light Display Manager