Skip to content

Commit

Permalink
v2.0.3 prep release. Profile now fully support python scripting inste…
Browse files Browse the repository at this point in the history
…ad of JSON. They also support importing archinstall and doing whatever the examples are doing - with one tiiiny TODO/hack/magic, the 'installer' session that is contextulized gets hard-inserted into the globals() scope. Since the child script won't actually have the global instance of the parent, we need to insert it to be known due to the way we import stuff
  • Loading branch information
Torxed committed Jul 8, 2020
1 parent 3ed8db5 commit aecd333
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
1 change: 1 addition & 0 deletions archinstall/lib/profiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ def load_instructions(self):
def install(self):
instructions = self.load_instructions()
if type(instructions) == Imported:
__builtins__['installation'] = self.installer # There's no easy way to give the imported profile the installer instance unless we require the profile-programmer to create a certain function that must be the same for all.. Which is a bit inconvenient so lets just make it truly global
with instructions as runtime:
log(f'Profile {self.name} finished successfully.')
else:
Expand Down
27 changes: 26 additions & 1 deletion profiles/desktop.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,27 @@
import archinstall
print('Installing desktop using:', archinstall)

arguments = {
'keyboard_layout' : 'sv-latin1',
"editor" : "nano",
"mediaplayer" : "lollypop gstreamer gst-plugins-good gnome-keyring",
"filebrowser" : "nemo gpicview-gtk3",
"webbrowser" : "chromium",
"window_manager" : "awesome",
"window_manager_dependencies" : "xorg-server xorg-xrandr xorg-xinit xterm",
"window_manager_utilities" : "feh slock xscreensaver terminus-font-otb gnu-free-fonts ttf-liberation xsel",
"virtulization" : "qemu ovmf",
"utils" : "openssh sshfs git htop pkgfile scrot dhclient wget smbclient cifs-utils libu2f-host",
"audio" : "pulseaudio pulseaudio-alsa pavucontrol"
}

installation.add_additional_packages("{_webbrowser} {_utils} {_mediaplayer} {_window_manager} {_window_manager_dependencies} {_window_manager_utilities} {_virtulization} {_filebrowser} {_editor}".format(**arguments))

with open(f'{installation.mountpoint}/etc/X11/xinit/xinitrc', 'a') as X11:
X11.write('setxkbmap se\n')

with open(f'{installation.mountpoint}/etc/vconsole.conf', 'a') as vconsole:
vconsole.write('KEYMAP={keyboard_layout}\n'.format(**arguments))
vconsole.write('FONT=lat9w-16\n')

awesome = archinstall.Application(installation, 'awesome')
awesome.install()

0 comments on commit aecd333

Please sign in to comment.